Page 1 of 1

Split records into two files using a sort.

PostPosted: Wed Jun 08, 2016 8:39 pm
by deepu2pani
Hi,

I have a File with 1000 records. After some records this file has value 'SPLIT' in the position 10-14. I want to split this file in to two files.

The data in the first file has to be from record 1 to till the record with the value 'SPLIT' in the position 10-14.
The Data in the second file has to be the remaining records (after the record with the value 'SPLIT' in the position 10-14 to end of the file).

I know we can do this very easily using the EASYTRIEVE. but i want to is this possible using the SORT.

Can some one please help me.

This is my first post, Please excuse me if there are any mistakes.

Thanks You.

Re: Split records into two files using a sort.

PostPosted: Thu Jun 09, 2016 1:32 am
by NicC
any mistakes

First, you have datasets, not files.
Second, you have given no definition of the dataset - LRECL, RECFM

Re: Split records into two files using a sort.

PostPosted: Thu Jun 09, 2016 1:39 am
by BillyBoyo
You use WHEN=GROUP to identify the SPLIT in the correct position, and PUSH the S from SPLIT. Then use two OUTFILs, one with INCLUDE= for the S, and an BUILD to drop off the extra byte, and other with SAVE, and the same BUILD,