Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you have z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can use DFSORT's new IFTHEN and OVERLAY parameters to do what you want as shown below. If you have DFSORT, but you don't have the Dec, 2004 PTF installed, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Use [URL] BBCode for External Links
Here's the DFSORT job. I assumed that your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Put 'K' in 81 and a seqnum in 82-89
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'K',82:SEQNUM,8,ZD)),
* If seqnum is 10-30, put 'D' in 81.
IFTHEN=(WHEN=(82,8,ZD,GE,+10,AND,82,8,ZD,LE,+30),
OVERLAY=(81:C'D')),
* If seqnum is 40-60, put 'D' in 81.
IFTHEN=(WHEN=(82,8,ZD,GE,+40,AND,82,8,ZD,LE,+60),
OVERLAY=(81:C'D'))
* Delete records with 'D' in 81. Remove 'K' and seqnum.
OUTFIL OMIT=(81,1,CH,EQ,C'D'),OUTREC=(1,80)
/*
|
|
|