View previous topic :: View next topic
|
Author |
Message |
madmartinsonxx
New User
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
I have a 10 byte input file of account numbers and an output file of 10 bytes. I need to drop duplicates from the input file, but, I need to keep the dropped records. I thought I could use the SAVE option of OUTFIL that I saw from another post but I cannot get the output for the dropped records without using INCLUDE it seems. I tried the following code but all I get is the records sort keeps and not the ones it drops.
Code: |
000007 //SORTIN DD *
000008 0000000000
000009 0000000000
000010 0000000001
000011 0000000001
000012 0000000002
000013 0000000003
000014 //OUT1 DD SYSOUT=*
000015 //OUT2 DD SYSOUT=*
000016 //SYSIN DD *
000017 SORT FIELDS=(01,10,CH,A)
000018 SUM FIELDS=NONE
000019 OUTFIL FNAMES=OUT1
000020 OUTFIL FNAMES=OUT2,SAVE
000021 /*
000022 //
|
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
madmartinsonxx,
Once you use SUM FIELDS=NONE , your duplicate records are gone by the time OUTFIL processing is done. You need to use SELECT operator with FIRST option. The following DFSORT/ICETOOL JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
0000000000
0000000000
0000000001
0000000001
0000000002
0000000003
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT1) DISCARD(OUT2) ON(1,10,CH) FIRST
//* |
|
|
Back to top |
|
|
madmartinsonxx
New User
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
thanks mucho ! i will keep this in my hip pocket. |
|
Back to top |
|
|
|