View previous topic :: View next topic
|
Author |
Message |
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 .) |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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"! ); until it's shown that its performance is unacceptable, I decline to go further. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Could this be a way in one card?
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
You're welcome. At last your TL is happy |
|
Back to top |
|
|
|