Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
ibmlearner,
The select operator of DFSORT can do that very easily
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
11111
11111 - REC2
11111 - REC3
22222
33333
33333 - REC2
//OUT DD SYSOUT=*
//DUPS DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(01,5,CH) FIRST DISCARD(DUPS)
/* |
The out file will have
The DUps file will have
Code: |
11111 - REC2
11111 - REC3
33333 - REC2
|
If you want the unique keys in one file and all the duplicates in another file then use the following JCL
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
11111
11111 - REC2
11111 - REC3
22222
33333
33333 - REC2
//OUT DD SYSOUT=*
//DUPS DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(01,5,CH) NODUPS DISCARD(DUPS)
/* |
The out file will have
The DUps file will have
Code: |
11111
11111 - REC2
11111 - REC3
33333
33333 - REC2
|
For more options on select check this link
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.11?DT=20060615185603
Hope this helps...
Cheers |
|