Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
eliminate duplicte using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: eliminate duplicte using sort
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    Post subject:
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 Moderator


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

PostPosted: Fri May 06, 2005 8:53 pm    Post subject:
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:

http://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    Post subject: Re: eliminate duplicte using sort
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    Post subject: Re: eliminate duplicte using sort
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 Moderator


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

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

umed,

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

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us