Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the one below to do what you asked for. I assumed your input file has RECFM=FB and LRECL=30, but you can change the job appropriately for other attributes. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN, OVERLAY and KEEPBASE functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 PTF, 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
For more information on using this "group" technique, see the following two Smart DFSORT Tricks:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmtrck.html#d01
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmtrck.html#d02
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/30)
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/30)
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(31,8,ZD) KEEPBASE -
WITHALL WITH(5,19) USING(CTL2)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(31:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,3,CH,EQ,C'Key'),
OVERLAY=(31:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(39:SEQNUM,8,ZD,
31:31,8,ZD,SUB,39,8,ZD,M11,LENGTH=8))
OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C' '),
BUILD=(7:12,17,31:31,16))
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(1,30)
/*
|
|
|