kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Feb 06, 2004 9:13 am Post subject: |
|
|
Sateesh,
The following JCL will give you desired results. I am assuming that your input file is 80 bytes in length and there will always be 4 records.
A brief explanation of the job. In step0100 We first create a temp dataset with a blksize in multiple of 320. By doing so we can override the lrecl in the next step so that we can read a set of 4 records as a single record. Also I am removing the decimal point to for easy comparision.
In step0200 we take the file created in the first step and override the lrecl to 320, so that we are reading 4 records as a single record. By doing so the the 2 line in your input file starts at 81 and 3 at 161 and 4th at 241 position. We now use an include condition to write out the records. While writting out we use the OUTFIL parm '/' to split the records back to 80 bytes.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
EXTRACT COUNT IS 26260
ROWWRITER COUNT IS 26260
THE DIFFERENCE IS 0
RATIO OF EXTRACTOR VS TRANSACTIONS 1.44
//SORTOUT DD DSN=&T1,DISP=(,PASS),
// SPACE=(CYL,(X,Y),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=27840)
//SYSIN DD *
INREC FIELDS=(1,36,38,2,80:X)
SORT FIELDS=COPY
//*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=OLD,LRECL=320
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(179,1,ZD,EQ,0,AND,(276,3,ZD,GE,140,OR,276,3,ZD,LE,200)),
OUTREC=(1,80,/,81,80)
OUTFIL FNAMES=OUT2,SAVE,
OUTREC=(1,80,/,81,80,/,161,80,/,241,36,C'.',277,43)
//*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|