Want to Split the input record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Want to Split the input record

Postby Hariprasad K » Mon Apr 16, 2012 6:16 pm

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.
Hariprasad K
 
Posts: 19
Joined: Sat Feb 25, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Want to Split the input record

Postby BillyBoyo » Mon Apr 16, 2012 6:59 pm

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
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Want to Split the input record

Postby Hariprasad K » Mon Apr 16, 2012 7:09 pm

yes it is working...... thanks a lot.....
Hariprasad K
 
Posts: 19
Joined: Sat Feb 25, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post