using TwinOakDemo.Members.Programs; using TwinOak.RPG.Runtime; using TwinOak.RPG.Runtime.Interfaces; using TwinOak.RPG.Runtime.Sorting; using TwinOak.RPG.Runtime.Types.Enums; using System.Collections.Generic; namespace TwinOakDemo.Members.Procedures { [RpgProcedure(library: "twinoak", procedure: "wn002")] public class Wn002_Proc : ProcedureMemberBase { public Wn002_Proc(IProviderService providers) : base(providers) { } protected override void RunStep(int stepNumber, params string[] args) { switch (stepNumber) { case 1: Workflow.OutputPrompt("* 'LIST WINE MASTER FILE'"); break; case 2: this.GetFileSorter() .AddInputFile("WINES", RetentionPolicy.Resident) .SetOutputFile("WN002S") .AddSortKey(DataType.Character, 27, 29) .AddSortKey(DataType.Character, 26, 26) .AddOutputBuffer(DataType.Character, 1, 108) .SortAndFilter(); break; case 3: IMemberControlBlock ctrlBlockWn002 = new MemberControlBlock() { FileAssociationTable = new FileAssociations() { { "WN002S", "WINES", Disposition.Shared }, } }; Wn002 wn002_Program = new Wn002(this.Providers); wn002_Program.Start(ctrlBlockWn002); break; default: Workflow.SignalEnd(); break; } } protected override void Cleanup(string[] args) { base.Cleanup(args); } } }