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. I assumed the maximum number of occurrences for FIELD1 is 5 but you can change the job appropriately for a different maximum. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/80)
//OUT DD DSN=... output file (FB/80)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,3,CH) KEEPNODUPS -
WITHEACH WITH(12,3) WITH(16,3) WITH(20,3) WITH(24,3) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,3))),
IFTHEN=(WHEN=(81,8,ZD,EQ,1),BUILD=(1,3,8:11,3)),
IFTHEN=(WHEN=(81,8,ZD,EQ,2),BUILD=(1,3,12:11,3)),
IFTHEN=(WHEN=(81,8,ZD,EQ,3),BUILD=(1,3,16:11,3)),
IFTHEN=(WHEN=(81,8,ZD,EQ,4),BUILD=(1,3,20:11,3)),
IFTHEN=(WHEN=(81,8,ZD,EQ,5),BUILD=(1,3,24:11,3))
/*
|
|
|