I need to process 2 million to 3 million records in my program, add/delete/modify wrt to given rules. These records need to be output in to another system. The Backend system, to which my program exports the file, can take in a file of max capacity 200,000. Now as I pointed out, the input can vary between 2 million and 3 million, so I can have 10 - 15 files after every run.
Now, I cannot send them a Blank file, they say its gonna kill them? I need to DYNAMICALLY allocate the files, say if there are 2.5 million records, there should be 13 files and no more.
Is there any way to code this in cobol, dyanamic FD statements? Or some utility in the IBM mainframe that can sync up with my Cobol Pgm to create these files dynamically?
I think you can use GDG with the limit as 13. You can use a counter and as it reaches 200,000, the program must terminate and you can again submit the job and start from the 200,001th record.
To start from this new record position you can accept the starting record position at run time and for that you don't have to change the program every time. For e.g for the first time the value supplied must be 1 for the first record,for the second time it must be 200,001 and so on.....
If this solve your problem then tell me or it may be that i don't understand your problem fully if that is the case then pl elaborate your problem fully. like
1. what is the record size , is it fixed or variable.
etc.
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
Hi new2cobol,
Quote:
I need to process 2 million to 3 million records in my program, add/delete/modify wrt to given rules. These records need to be output in to another system. The Backend system, to which my program exports the file, can take in a file of max capacity 200,000. Now as I pointed out, the input can vary between 2 million and 3 million, so I can have 10 - 15 files after every run.
Now, I cannot send them a Blank file, they say its gonna kill them? I need to DYNAMICALLY allocate the files, say if there are 2.5 million records, there should be 13 files and no more.
Is there any way to code this in cobol, dyanamic FD statements? Or some utility in the IBM mainframe that can sync up with my Cobol Pgm to create these files dynamically?
I?m going to key on something you said above, that the backend process could accept a max capacity of 200,000 records from a single file. I believe I would approach this a little differently, instead of filling each file to the max capacity, I would send them, with room for expansion, maybe 20 files. Every time, with an approximate equal number of records in each file.
You could do this in a single program, or you could make the process into two programs.
That was a good stuff from you. But I do believe that Intermediate file should be opened in I-O mode (which will enable to open or close in the same pgm). Isn't it?
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
prabs2006,
Opening in I-O mode says that you can read and/or write/rewrite to the file while it's open. In this case I want open for output to sequentially write until all of the data has been written, counting the number of records. Then, closing the file and re-opening as input resets the current record pointer back to the first record, and it can then be sequentially read until eof.
I didnt get ur point here. You mean to say any file opened in output mode can be closed and can be opened in input mode in the same pgm. I am afraid this will not be possible.
Hi Jack,
As far as I have gone thru the link, it doesn't have anything that we discuss here.