Page 1 of 1

Want to Split the input record

PostPosted: Mon Apr 16, 2012 6:16 pm
by Hariprasad K
Hi All
I have a requirement like, input file contains 10 records with record length of 80 bytes.
Each record first 10 bytes was Emp-Name and remaining 70 bytes has Emp-Salary for seven months and each month salary contains 10 bytes.
Now I have to write into output file like first record Emp-Name and first record 11th position to 20th position date as first record.
Second record contains first record Emp-Name and first record 21th position to 30th position date as first record.
Like I have to write end of the first record and again repeat same process for second record.
Ex: input file (give only one record as example)
aaaaaaaaaa1111111111222222222233333333334444444444555555555566666666667777777777
Output file (required output)
aaaaaaaaaa1111111111
aaaaaaaaaa2222222222
aaaaaaaaaa3333333333
aaaaaaaaaa4444444444
aaaaaaaaaa5555555555
aaaaaaaaaa6666666666
aaaaaaaaaa7777777777
I am using SYNC SORT, this is my first post, please ignore my question is not clear.

Re: Want to Split the input record

PostPosted: Mon Apr 16, 2012 6:59 pm
by BillyBoyo
This makes use of the / (slash operator). Tested with DFSORT. No idea if you have access to it.

//SPLITREC EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL BUILD=(1,10,11,10,/,
                1,10,21,10,/,
                1,10,31,10,/,
                1,10,41,10,/,
                1,10,51,10,/,
                1,10,61,10,/,
                1,10,71,10)
//*
//SORTIN   DD *
AAAAAAAAAA1111111111222222222233333333334444444444555555555566666666667777777777


Output is:

AAAAAAAAAA1111111111
AAAAAAAAAA2222222222
AAAAAAAAAA3333333333
AAAAAAAAAA4444444444
AAAAAAAAAA5555555555
AAAAAAAAAA6666666666
AAAAAAAAAA7777777777

Re: Want to Split the input record

PostPosted: Mon Apr 16, 2012 7:09 pm
by Hariprasad K
yes it is working...... thanks a lot.....