ICE201I A RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-I40658 C6-I35397 C7-I35397 C8-I40658 E9-I40658 C9-I35397 E5-I35397
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R2 - 21:09 ON MON MA
SORT FIELDS=(1,23,CH,D),EQUALS
SUM FIELDS=NONE
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS
ICE088I 1 DEVDB2QR.STEP030 . , INPUT LRECL = 52, BLKSIZE = 27976, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,134217728,134204510)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (134143984,134143984)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=134217728,MAXLIM=6291456,MINLIM=450560,EQUALS=Y,LIST=Y,E
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=N,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=134217728,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CF
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y,TUNE=STOR,EXPMAX=MAX ,EXPOLD=50% ,E
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE750I 0 DC 27976 TC 0 CS DSVUU KSZ 27 VSZ 27
ICE752I 0 FSZ=538 RC IGN=0 E AVG=56 0 WSP=39 C DYN=0 0
ICE751I 1 DE-I35397 D5-I35397 D9-I35397 E8-I40658
ICE090I 0 OUTPUT LRECL = 52, BLKSIZE = 27976, TYPE = FB
ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 7
ICE054I 0 RECORDS - IN: 12, OUT: 5
ICE134I 0 NUMBER OF BYTES SORTED: 624
ICE253I 0 RECORDS SORTED - PROCESSED: 12, EXPECTED: 538
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
@sergeyken
Actually, I don't need records to be sorted again as this file is already sorted (Key: 1-23). I want duplicates to be removed keeping the 1st key record as it appears in input.
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
Quote:
Actually, I don't need records to be sorted again as this file is already sorted (Key: 1-23). I want duplicates to be removed keeping the 1st key record as it appears in input.
Based on what you have shown, the file is sorted on the key in ASCENDING order.
You are resorting in descending order. Totally different.
Furthermore, when using equals parameter on a descending sort, is the FIRST or LAST record (from the ascending perspective) be the one to be kept?
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
If th data is already sorted in the sequence that you want and a set of records with the same key is a group and the first record is the one that you want then use the GROUP keyword and add a sequence number that resets on change of group and on the ouput phase include only the records witha sequence number of 1 and remember to remove the sequence number from the output record.
I have never done this but I read most posts and know that there examples in the forum - all you have to do is look for them.
This is the same order as in input. But in my output I am getting the last key record.
I am wondering which control statements got you this result. I ran a test with sort ascending (though sorting is not needed to achieve what you want) and it gave your expected results.
Nic/RahulG31 has pointed out possible solutions here, and if you choose to go with an ICETOOL SELECT, make sure you use a COPY override, so you won't end up in re-sorting your data.