kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Apr 20, 2009 11:09 am Post subject: |
|
|
Sreejith,
The following DFSORT JCL will give you the desired results. I assumed that you don't want to split the record if it has spaces.Since there are 3 different chunks of 80 byte data to check , the unique combinations will be 3 factorial which is 6. so we check for the 6 possible values and write out the records. These checks are to ensure that you don't write out blank records.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Yu=our 250 byte input file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(1,240,C'111')),
IFTHEN=(WHEN=(001,1,CH,EQ,C' '),OVERLAY=(241:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(081,1,CH,EQ,C' '),OVERLAY=(242:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(161,1,CH,EQ,C' '),OVERLAY=(243:C'0'))
OUTFIL IFOUTLEN=80,OMIT=(241,3,ZD,EQ,0),
IFTHEN=(WHEN=(241,3,ZD,EQ,001),BUILD=(161,80)),
IFTHEN=(WHEN=(241,3,ZD,EQ,010),BUILD=(81,80)),
IFTHEN=(WHEN=(241,3,ZD,EQ,011),BUILD=(81,80,/,161,80)),
IFTHEN=(WHEN=(241,3,ZD,EQ,100),BUILD=(1,80)),
IFTHEN=(WHEN=(241,3,ZD,EQ,101),BUILD=(1,80,/,161,80)),
IFTHEN=(WHEN=(241,3,ZD,EQ,110),BUILD=(1,80,/,81,80)),
IFTHEN=(WHEN=(241,3,ZD,EQ,111),BUILD=(1,80,/,81,80,/,161,80))
/* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|