kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Jun 04, 2009 1:12 pm Post subject: |
|
|
martin,
The following DFSORT/ICETOOL JCl will give you the desired results. I assumed that the value you need to check is in pos 1 for 5 bytes and the seqnum field to be populated is 8 bytes in pos 131.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=your 150 byte FB file,DISP=SHR
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SORT FROM(T1) USING(CTL2)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(151:SEQNUM,8,ZD,SEQNUM,3,ZD,START=125,INCR=125,5X)),
IFTHEN=(WHEN=(159,3,ZD,EQ,0),
OVERLAY=(162:1,5,167:SEQNUM,8,ZD,RESTART=(159,8))),
IFTHEN=(WHEN=(159,3,ZD,GT,0),OVERLAY=(159:8C'0'))
OUTFIL FNAMES=T1,IFOUTLEN=167,
IFTHEN=(WHEN=(167,1,CH,GT,C' '),
BUILD=(150X,151,8,ZD,SUB,+3,M11,LENGTH=8,167,8,/,1,159))
//CTL2CNTL DD *
SORT FIELDS=(151,8,CH,A),EQUALS
SUM FIELDS=(159,8,ZD)
OUTFIL FNAMES=OUT,IFOUTLEN=150,
IFTHEN=(WHEN=(159,8,ZD,GT,0),OVERLAY=(131:159,8))
/* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|