Please help me on below job optimization. Where i am trying to combine two syncsort steps in one step.
Step 1: Output file of this step will be input to second step.
Code:
01,CH,A, **BUY-SELL INDICATOR
111,08,PD,A, **ORDER QUANTITY
16,10,CH,D) **BATCH DATE
OUTREC FIELDS=(1:1,1157,243X)
END
Step 2:
Code:
SORT FIELDS=(59,06,PD,A, **ACCOUNT NUMBER
52,06,PD,A, **SECURITY NUMBER
66,10,CH,A, **TRADE DATE
109,01,CH,A, **BUY-SELL INDICATOR
111,08,PD,A) **ORDER QUANTITY
SUM FIELSORT FIELDS=(59,06,PD,A, **ACCOUNT NUMBER
52,06,PD,A, **SECURITY NUMBER
66,10,CH,A, **TRADE DATE
109,DS=NONE **REMOVE DUPLICATE /PICK LATEST REC
END
In the first step input file is getting sorted on 6 different keys.
In the second step we are removing duplicates with same keys which is used in first step but having only five keys. One key which is not included in this step is "batch date(16,10,CH,D)" So while removing duplicate, most recent batch date records will be picked and rest will be deleted based on the given key in second step.
I searched to get existing case for this type of requirement but failed. So please help me to combine both step in one step if possible.
Note - I have Syncsort/ICETOOL license in my workshop.