I have a requirement to split an input file into multiple files using SYNCSORT or FILEAID. Input file will look like this:
I want to split this input file into 3 different output files as:
Output file 1:
Output file 2:
Output file 1:
I can't use STARTREC and ENDREC options as records numbers will vary each time. Same reason for SPLIT option.
Any help on this would be great.
Thanks & Regards,
P.S. I will definitely post the answer if I got the answer in the mean time
Its very easy to split a file using file-aid. No need to write any JCL for that
Just follow the following process to split a file
1) go to option 3.3 in file aid
2) specify your from and to file name
3) Then give selection criteria usage as 'T'
4) Then it will take you to the next screen where it will have 3 options
5) choose the first one 'OPTION'
6) Then in the following screen u can have your own criteria to select records e.g forward or backward, no of records to skip, no of records to select etc....
Specify Selection Criteria Options:
Start at the following record key
(both blank for start of dataset)
Starting record key ===>
- OR - OR at the following RBA or RRN
Starting RBA or RRN ===>
Initial records to skip ===> 0 then skip this many records
Subsequent Selection Interval: then repeat the following
Records to select ===> 1 - select this many records
Records to skip ===> 0 - then skip this many records
Number of records to search ===> ALL you have read this many records
Number of records to select ===> ALL or selected this many records
SEQ/VSAM processing direction ===> F (F = Forward; B = Backward)