is a record group. (Records starting with 'HEADER' till the next record starting with 'HEADER' forms a record group)
My input file is huge. My need is to split the input file into 25 smaller files, with each smaller file consists of 100 record groups.
For discussion purposes in this forum, lets assume I need to split the file into 2 smaller files only, with each file to consist of 10 record groups. To achieve this, I had coded the following sort:
The processing of CTL1 and CTL2 seems to be fine and as expected. But CTL3 does not produce the expected result. As you can see, CTL1 and CTL2 adds separate sequence numbers to each record and each record group. I was expecting that now with CTL3, I need to just check the sequence number for each record group and write into two files. Apparently, it seems I am wrong with CTL3 in that that the sequence number for every other record that is not a 'HEADER', the value is spaces and all those records go to FILE1. Please let me know if my question is not clear.
What I would like to know is how can I modify CTL3 (or this sort itself), so that I can separate the input file into 2 smaller files each having 10 record groups.
I have syncsort at my shop, but I think the same will work with dfsort also. So, I am interested to see a dfsort solution too.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Aug 03, 2004 5:30 am Post subject:
kamur,
I quickly glanced thru your job, and I don't think it will produce the desired results. You will need STARTREC and ENDREC parms. I will try to post something when I get to work.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Aug 03, 2004 10:34 am Post subject:
kamur,
It is getting too complicated to generate the startrec and endrec for all the files. It is involving at 4 passes of the data. Even though I am a big fan of SORT, I prefer a program for this kind of splitting. And with easytrieve it is just a max of 30 lines of source code.
Here is an easytrieve solution to split the records into different groups
After seeing your post today, I also tried coding using startrec, endrec. I was halfway thru coding it and I saw your post again. Yes, I agree it is getting too complicated to build dynamic cards for each split...Unfortunately, I dont have eztrieve at my shop...but guess what??
When there is no easy SORT solution, FILEAID always comes into picture.
And when there is no easy FILEAID solution, SORT always comes to rescue.
I added another FILEAID step and resolved it pretty easily. So now the job is done in 2 steps: First a Synctool step and second a simple Fileaid.
We can keep adding however splits we need like this in the fileaid, it is pretty easy. Just one line of card for one file .
Just to add....MVSFORUMS have been great since its beginning and I have been an active browser of this site. Incase if anyone is wondering, I was registered to this site on Dec 2002 and this is my first question/post on this site. Guess why??? I always search, I always go through manuals, I always find solutions in this site (and another similar site). This forum is great and keep up the great work. I am as active as anyone can be on mvsforum site.
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