Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Is there are any way to identify the duplicate keys in a record and display using DFSort. |
Yes, you can do that with the SELECT operator of DFSORT's ICETOOL.
But exactly what you'd do depends on what you want to display.
Some examples:
If you have keys like this:
AAA
AAA
BBB
CCC
CCC
CCC
DDD
and you want to display the second and subsequent duplicates, e.g.
AAA
CCC
CCC
you can use this DFSORT/ICETOOL job:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//SHOW DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) DISCARD(SHOW) ON(1,3,CH) FIRST
/*
|
If you want to display all of the duplicate records, e.g.
AAA
AAA
CCC
CCC
CCC
you can use this DFSORT/ICETOOL job:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//SHOW DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(SHOW) ON(1,3,CH) ALLDUPS
/*
|
If you want to display one record for each duplicate, e.g.
AAA
CCC
you can use this DFSORT/ICETOOL job:
Code: |
//S3 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//SHOW DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(SHOW) ON(1,3,CH) FIRSTDUP
/*
|
If you want to do something else, please explain exactly what you want to do and show an example of the input records and output records.
For complete details on the SELECT operator of DFSORT's ICETOOL, see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.11?DT=20060615185603 |
|