I am executing IMS program through a JCL. The output file of the program is having millions of records. I want to split that file into number of files. But the problem is that the number of records in output file are not fixed , means i dont know the number of smaller files in which the bigger file need to be divided. SO can you tell me how to split the file.
But the problem is that the number of records in output file are not fixed , means i dont know the number of smaller files in which the bigger file need to be divided. SO can you tell me how to split the file.
You saying dont know number of records. This should not be issue because we can find out number of records in the file..
What will be count of o/p files if you know count lets say 10,000?
Do you mean to say you want every X number of records TO be written into one file and use new?
Ya exactly...Lets say i am getting 1 million records in the file. .I want to write 10,000 records in one file and next 10,000 in other file and so on..
Each file will contain 10,000 records, but the number of records would be different each time the program runs.
We have to FTP the file to the server of a system which is working on some other technology...and if we FTP the file containing such a huge number of records...it would not be possible for them to process that...
So we have to split file and pass it to other system..
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
Hi Expat,
expat wrote:
But what is the reason for wanting the file to be split up ?
I've a business reason for a similar scenario here at my shop:
There is a COBOL Batch Program which generates the print reports for the mechants, if the report is less than or equal to eight pages report should be sent in "trifold form" else it should be sent as a "flat insertion". This helps to the end worker who collects these reports - there are two different printer set-up for this - reports get printed, inserted in envelopes & are collected in different buckets; I believe, in some manner, this helps USPS personnels.
The above job is for writing 5 records each into each of the split files. If you want to have N records in the each file you should modify the below control statements.
Is it possible to get splitted records in GDG version, i have requirement to concatnate all these files in next step and i will not know the number of files.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
I believe there is something that i misunderstand. . . Please clarify why there is a need to concatenate as input the files just split?
Also, suggest you read about Generation Data Sets in the JCL manual available vis the "IBM Manuals" link at the top of the page. I suspect that you will not use a "version", but rather a "generation". Version has a special use and i do not believe this is what you ask about. And no, you probably will not use a gdg for this requirement.
It may help if you clearly post your requirement showing some sample input, the output you want from that input and the "rules" for getting from that sample input to the output. Also mention the recfm and lrecl of the files and the relevant positions in the data to accomplish your requirement.