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
 

 

Eliminating Duplicates and Sorting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Wed Jan 19, 2011 9:38 pm    Post subject: Eliminating Duplicates and Sorting
Reply with quote

We have a data set with LRECL=10 and RECFM=FB. Data are of the sort:
Code:
1234567890
867ABC5309
1234567890
2345678901
BE45789XYZ

We want to eliminate duplicate records and sort on position 10. This is trivial to do in two steps; but can it be done in one? (My team lead feels that one step with a hundred control cards is less "messy" than two steps with a total of three control cards icon_rolleyes.gif .)
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Jan 19, 2011 10:14 pm    Post subject:
Reply with quote

you could use icetool,

cntl1 would sort and drop dups based on 1 thru 10
cntl2 would sort on 10 - which does not make much sense, but doesn't matter.

you would have 2 cards for toolin
you would have 2 cards for cntl1 sort fields 1,.10 and sum
you would have 1 card for cntl2 sort fields 10,1

so you would have a total of 5 cards and either 3 inline datas
or 3 members in a parm lib.

takes two passes either way, whether 1 step or 2.

i have found that icetool is really good for exotic things like your problem.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Wed Jan 19, 2011 11:30 pm    Post subject:
Reply with quote

Well, it's not a problem per se. Unlike some querents, I have no problem with telling project managers and BAs, "What you want can't be done". I'm not a *Sort/*Tool maven, though; maybe it could be done, and I just didn't know how.

In any case, my team lead has little enough experience with SyncSort, and none with SyncTool; I have more with *Sort (although, as I said, I'm by no means an expert), but also none with *Tool. I helped him with the two-step sort job (and told him firmly, "You can't allocate the same data set to both SORTIN and SORTOUT! Bad team lead! No Jolt"! icon_biggrin.gif); until it's shown that its performance is unacceptable, I decline to go further.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jan 20, 2011 4:59 am    Post subject:
Reply with quote

Hi,

here is a way of achieving it with 2 cards
Code:
//STEP0100 EXEC PGM=SYNCTOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN=input                                               
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  SELECT FROM(IN) TO(OUT) ON(1,10,CH) FIRST USING(CTL1)               
//CTL1CNTL DD *                                                       
  SORT FIELDS=(10,1,CH,A,1,9,BI,A)                                   
/*                                                                   


Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Thu Jan 20, 2011 11:19 am    Post subject:
Reply with quote

Could this be a way in one card? icon_biggrin.gif
Code:
//SYSIN    DD  *                               
 SORT FIELDS=(10,1,CH,A,1,9,CH,A)             
 OUTREC OVERLAY=(11:SEQNUM,8,ZD,RESTART=(1,10))
 OUTFIL INCLUDE=(11,8,ZD,EQ,1),BUILD=(1,10)   
/*                                             
SORTIN
Code:
1234567872
867ABC5309
1234567890
1234567881
1234567872
867ABC5309
1234567890
2345678901
1234567881
BE45789XYZ
1234567890
SORTOUT
Code:
BE45789XYZ
1234567890
1234567881
2345678901
1234567872
867ABC5309
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Thu Jan 20, 2011 9:27 pm    Post subject:
Reply with quote

My TL says that that works perfectly, Arun. I disclaimed authorship, and told him I'd pass his appreciation on to you. Thanks very much.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Fri Jan 21, 2011 8:36 am    Post subject:
Reply with quote

You're welcome. At last your TL is happy icon_biggrin.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am


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