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

Eliminating Duplicates and Sorting


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Akatsukami

Global Moderator


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

PostPosted: Wed Jan 19, 2011 9:38 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Jan 19, 2011 10:14 pm
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: 1788
Location: Bloomington, IL

PostPosted: Wed Jan 19, 2011 11:30 pm
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: 1702
Location: Australia

PostPosted: Thu Jan 20, 2011 4:59 am
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: 2481
Location: @my desk

PostPosted: Thu Jan 20, 2011 11:19 am
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: 1788
Location: Bloomington, IL

PostPosted: Thu Jan 20, 2011 9:27 pm
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: 2481
Location: @my desk

PostPosted: Fri Jan 21, 2011 8:36 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts Sorting a record spanned over multipl... DFSORT/ICETOOL 13
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
Search our Forums:

Back to Top