Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Remove duplicates in jcl sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
selvakumar_ms

New User


Joined: 30 Mar 2004
Posts: 8

PostPosted: Sat Apr 10, 2004 6:14 pm    Post subject: Remove duplicates in jcl sort
Reply with quote

hi,
is there any chance to remove duplicates in jcl sort?
Back to top
View user's profile Send private message

bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Sat Apr 10, 2004 7:20 pm    Post subject:
Reply with quote

hello,

Code:

//sysin dd*
sort fields=(p1,l1,ch)
sum fields=none


p1 pos of dup
l1 length
ch sort parm for character
Back to top
View user's profile Send private message
selvakumar_ms

New User


Joined: 30 Mar 2004
Posts: 8

PostPosted: Mon Apr 12, 2004 2:43 pm    Post subject:
Reply with quote

bluebird wrote:
hello,

Code:

//sysin dd*
sort fields=(p1,l1,ch)
sum fields=none


p1 pos of dup
l1 length
ch sort parm for character


excuse me i couldn't get u
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Apr 13, 2004 6:19 pm    Post subject: To remove duplicates
Reply with quote

hi selvakumar_ms,

I will try to xplain you more clearly for what bluebird said:


//sysin dd*
sort fields=(p1,l1,ch)
sum fields=none

In the above sysin stmt,if we specify sum fields=none it will automatically take care of removing duplicates while sorting.

p1 in sort filelds is nothing but the position of duplicates.
l1 is length of those fields from p1.
ch is sort parameter for character.


If you have key field of length 7 bytes on which you want to eliminate duplicates then the following JCL will give you the results.

Code:
Code:

//STEP001  EXEC PGM=SORT
//*
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YOUR.INPUT.FILE,
//            DISP=SHR
//SORTOUT  DD DSN=YOUR.OUTPUT.FILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *
   SORT FIELDS=(1,7,CH,A)
   SUM FIELDS=NONE
/*             



Thanks
Anu
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Wed Apr 14, 2004 12:30 pm    Post subject:
Reply with quote

thanx anurada. Nice to see that somebody outthere reads me...
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us