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

eliminate duplicte using sort


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

New User


Joined: 29 Mar 2005
Posts: 62

PostPosted: Fri May 06, 2005 10:29 am
Reply with quote

Hi,
any one plz sugest me with syntax how to eliminate duplicate record using sort,

bye,
kumar
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Fri May 06, 2005 11:01 am
Reply with quote

Hi Kumar,
Use SUM FIELDS=NONE in your sort card.

regards,
David.
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: Fri May 06, 2005 8:53 pm
Reply with quote

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
View user's profile Send private message
umed

New User


Joined: 13 May 2005
Posts: 38

PostPosted: Mon May 16, 2005 11:43 am
Reply with quote

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
View user's profile Send private message
avalanches

New User


Joined: 10 May 2005
Posts: 28

PostPosted: Mon May 16, 2005 3:23 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon May 16, 2005 8:40 pm
Reply with quote

umed,

You can use the SELECT operator of DFSORT's ICETOOL to do that as explained in this "Smart DFSORT Trick":

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst01.html#t12
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top