Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I have a file which has duplicate records, I need to write only these duplicate records to output file |
Depending on what you want to do, that Smart DFSORT Trick might or might not be relevant. For example, if you want to write ALL of the duplicate records to the output file (e.g. input: AAA, AAA, AAA,BBB; output: AAA,AAA,AAA), then you could use a DFSORT/ICETOOL job like this:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(p,m,f) ALLDUPS
/*
|
where p,m,f is the starting position, length and format of the field you want to check for duplicates on (you can use more than one ON field if necessary).
For complete information on all of the functions available with the SELECT option of DFSORT's ICETOOL, see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.11?DT=20060615185603
If you need more specific help, show an example of the records in your input file (relevant fields only) and what you expect for output. |
|