Nithya Usha Mohanan
New User
Joined: 16 Oct 2007 Posts: 7 Location: pune
|
|
|
|
Hi ,
I want to create a sort card which executes multiple conditions like the below.
I have a input file of 285 length which has a header starting with T . Need to split this file into three.
first file having 1:568 ( possible by coding outrec)
second file ( backup of inp without header, possible by including all records without first char 'T')
the third file which is having data from length 1:14 and 580 to 685 of input file. I need to append a header for this file and should format it to make it a Tab delimited file.
Thanks and regards,
Nithya |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Nithya Usha Mohanan wrote: |
Hi ,
I have a input file of 285 length which has a header starting with T . Need to split this file into three.
the third file which is having data from length 1:14 and 580 to 685 of input file. I need to append a header for this file and should format it to make it a Tab delimited file.
Thanks and regards,
Nithya |
Nithya,
If your input file is only 285 bytes , how do you plan to create the 3rd with data from bytes 580? for a length of 106 bytes? was that a typo? is it meant to be 280 to 285? Assuming that it is a typo , use the following DFSORT JCL which will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input FB 285 byte file,DISP=SHR
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//OUT3 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,OVERLAY=(568:X)
OUTFIL FNAMES=OUT2,OMIT=(1,1,CH,EQ,C'T')
OUTFIL FNAMES=OUT3,
IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
BUILD=(C'COLUMN HEADER1',X'05',C'HEAD2')),
IFTHEN=(WHEN=NONE,BUILD=(1,14,X'05',280,6))
//* |
|
|