cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
I have a single input file and would expect a single output file.
Input:
Code: |
----+----1----+----2----+----3----+----4
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
CD5678 YYYYYYYYYYY
CD5678 YYYYYYYYYYY
CD5678 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
|
Using the USERID in position 1-6 of the input file, can ICETOOL flag the last record of each set with an "*" (asterisk)?
Output:
Code: |
----+----1----+----2----+----3----+----4
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY
AB1234 YYYYYYYYYYY *
CD5678 YYYYYYYYYYY
CD5678 YYYYYYYYYYY
CD5678 YYYYYYYYYYY *
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY
EF9012 YYYYYYYYYYY *
|
This isn't my exact requirement, but after seeing the ICETOOL control cards, I should be able to adapt it to my setup.
Thanks in advance. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for. Note that there's a system restriction related to the use of referback for concatenation with multiple volumes, so you might want to have the SELECT in one ICETOOL step and the SORT in another if that's a concern.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
// DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,6,CH) LAST DISCARD(T2) USING(CTL1)
SORT FROM(CON) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(21:C'*')
OUTFIL FNAMES=T2
/*
//CTL2CNTL DD *
OPTION EQUALS
SORT FIELDS=(1,6,CH,A)
/*
|
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
The solution worked fine. I see the methodogy of splitting out the last record of each userid set, flagging it, and sorting it back together with the non-selected records. Thank you for all your invaluable advice on this problem as well as all the others. |
|