IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Identifying the duplicate keys and displaying thru DFSort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
veer

New User


Joined: 11 Nov 2006
Posts: 6

PostPosted: Thu Dec 14, 2006 4:18 am
Reply with quote

Hi,

Is there are any way to identify the duplicate keys in a record and display using DFSort.

I understand that duplicates can be eliminated thru DFSort, but i have a need to identify those keys before eliminating.

Thanks in advance.

Veer
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 14, 2006 5:50 am
Reply with quote

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
Back to top
View user's profile Send private message
veer

New User


Joined: 11 Nov 2006
Posts: 6

PostPosted: Fri Dec 15, 2006 4:21 am
Reply with quote

Thanks a lot Frank for the very detailed explanation.
I appreciate you taking the time to help me with this request.

Thanks again

Veer
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top