Posted: Fri Jan 27, 2012 2:33 am Post subject: How to split file by multiple dup recs into multiple files.
I have researched the forums and the manuals. i think i am trying to take Sort /SPLIT to far, but wanted to find out if this is possible.
I have a 100,000 rec file (volume always changes) that is sorted in keyed order by first 50 bytes, There is always multiple duplicate key records. I want to SPLIT the file into 4 some what equal output data sets with the duplicate keys on the same output date set, before writing to the next data set. Since the key values always change, i cant code them in sort. The number of duplicate records is variable also.
The idea would be each time key changes write to the next data set revolving thru the 4 files.
The SPLIT functions doesn't seem to be able to do variable splits based on key.
Joined: 18 Feb 2006 Posts: 812 Location: San Jose, CA
Posted: Fri Jan 27, 2012 3:34 am Post subject:
If I understand correctly what you want to do, you can use a DFSORT job like the following. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. I also assumed your records were already in sorted order by the key (if not, use SORT and OUTREC instead of COPY and INREC).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum