Split records into two files using a sort.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Split records into two files using a sort.

Postby deepu2pani » Wed Jun 08, 2016 8:39 pm

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.
deepu2pani
 
Posts: 1
Joined: Wed Jun 08, 2016 8:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Split records into two files using a sort.

Postby NicC » Thu Jun 09, 2016 1:32 am

any mistakes

First, you have datasets, not files.
Second, you have given no definition of the dataset - LRECL, RECFM
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Split records into two files using a sort.

Postby BillyBoyo » Thu Jun 09, 2016 1:39 am

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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post