View previous topic :: View next topic
|
Author |
Message |
karthikuma
New User
Joined: 29 Mar 2005 Posts: 62
|
|
|
|
Hi,
any one plz sugest me with syntax how to eliminate duplicate record using sort,
bye,
kumar |
|
Back to top |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
Hi Kumar,
Use SUM FIELDS=NONE in your sort card.
regards,
David. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Kumar,
If you just want to keep the first record with each key, you can do that using DFSORT as follows. p,m,f is the starting position, length and format of your key.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION EQUALS
SORT FIELDS=(p,m,f,A)
SUM FIELDS=NONE
/*
|
Alternatively, you could use this DFSORT/ICETOOL job:
Code: |
//S2 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) FIRST
/*
|
DFSORT's SELECT operator also gives you other choices (LAST, FIRSTDUP, LASTDUP, ALLDUPS, NODUPS, HIGHER(n), LOWER(n), EQUAL(n), DISCARD(savedd)) for how you handle the duplicates.
For complete details on the SELECT operator of DFSORT's ICETOOL, see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/6.11?DT=20050222160456 |
|
Back to top |
|
|
umed
New User
Joined: 13 May 2005 Posts: 38
|
|
|
|
Hi ,
Wht shud we do if we want to add the duplicated file into a seprate
file?
here it means tht i require two files
1. file containing records where duplicates are removed
2. file which contains only duplicated records.
thx in advance
umed |
|
Back to top |
|
|
avalanches
New User
Joined: 10 May 2005 Posts: 28
|
|
|
|
Hey,
To achieve these two files, we need to have another DD with the name SORTX in the steps & SUM FIELDS = XSUM. The data set associated with SORTX will contain the removed duplicates.
Cheers,
avalanches |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|