Just to clarify, you want 2 separate output files, correct?
In the first step, why are you coding an include statement if you want all the records? Will your actual input data contain other values in that field (other than D, E or I)? If not, then you can remove the INCLUDE statement. Also, the output you posted for the first step is incorrect. The output that would be produced from these control statements is as follows:
Code:
D TEST 00
E TEST 00
E TEST 10
I TEST 00
I TEST 10
I TEST 20
If you want the output produced as your posted result, then you would need to code:
Code:
SORT FIELDS=(3,5,CH,A,8,2,CH,A)
In regards to your second step, your output is also incorrect. For what you coded, you would only get 1 record in the output. Please be more specific as to the rules. Are you looking to produce only the last record for each sort key, or the maximum value for field (8,2) for each sort key, which happens to be the last record in your sample input records? Or something else? _________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Joined: 14 Jan 2009 Posts: 37 Topics: 0 Location: USA
Posted: Tue Mar 03, 2009 11:23 am Post subject:
retep baar: Here is a single sort coding solution that retains the MAX value from each of the D, E and I records:
Code:
//SYSIN DD *
SORT FIELDS=(3,5,CH,A,1,1,CH,A)
INCLUDE COND=(1,1,CH,EQ,L(C'D',C'E',C'I'))
DUPKEYS MAX=(8,2,ZD)
Hope this helps! Please let me know if you require additional assistance with this. _________________ Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum