Howard Brazee wrote:
>Am I being more clear now?
I'm not sure. It would have helped if you'd answered the question I asked:
Are you looking for "L" specifically, or "L" because it collates after '*'
or what?
If you want the 'L' because it collates after the '*', then this
DFSORT/ICETOOL job
would do that:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,10,CH) ON(22,1,CH) LASTDUP -
USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,10,CH,A,22,1,CH,A,21,1,CH,A)
/*
We sort on 1-10 and 22 to get the "dup" records together,
and on 21 to get the 'L' collated after the '*' for the
dup records. SELECT gets the last dup for 1-10 and 22
which would be the 'L' record since the SORT collated the
'L' record after the '*' record.
//OUT would have:
212345678900000000{ *E033333
212345678900000000{ LN033333
212345678900000000{ *Q033333
Note that the N record comes before the Q record because
that's the way they would collate on 21. You can't remove
dups on one key and sort on another key in the same pass,
so if you want the records sorted by 21-22 for output
(*Q before LN), you'd have to do another sort on 21-22.
In that case, the following DFSORT/ICETOOL job would do
what you want:
//S2 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)
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,10,CH) ON(22,1,CH) LASTDUP
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,10,CH,A,22,1,CH,A,21,1,CH,A)
/*
//CTL2CNTL DD *
SORT FIELDS=(1,10,CH,A,21,2,CH,A)
/*
Frank Yaeger - DFSORT Team (IBM)
Specialties: ICETOOL, IFTHEN, OVERLAY, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html