
At the beginning of the program include a logic to check if the output file is empty or non-empty.However, if the program appends due to any reason the output file will have the last successfully inserted and committed record. 1000th record is inserted successfully we will empty the output file. Repeat the above process for each 100th record inserted, i.e., 100th, 200th, 300th and so on.Make sure to open this separate output file in I/O mode so that we can REWRITE the record each time.

As soon as WS-COUNT reaches the commit frequency 100, we will write the last inserted record key (key field) in a separate output file, initialize WS-COUNT and fire COMMIT statement.Increment the counter WS-COUNT by one each time a record is inserted successfully. Place a loop in which we will read the record from the file and insert it in a database.Declare a variable for a counter, say WS-COUNT.If we choose a commit frequency of 100, then the following steps need to be performed: The restart logic can be implemented in a COBOL-DB2 program by fixing a commit frequency. How will you implement restart logic? Solution But I don't have one handy at the moment, and my Google-FU has failed me.Problem: A COBOL-DB2 program takes the data from an input file having 1000 records and inserts the data in a DB2 table. I question why you think you actually to generate an FDF file for every table.Īs I recall, the format of the FDF (or it's newer variant FDFX) is pretty simple it shouldn't be all that difficult to generate if you really wanted to. Which explain why there's no built-in way to create an appropriate FDF file for every table on the system.

You can use the resulting FDF file to upload a modified version of the downloaded data or as the starting point for creating an FDF file that matches the actual data you want to upload. Sure you can turn on an option during the download from Db2 to create the FDF file, but it's still actually describing the data in the stream file you've just downloaded the data into. It actually describes the format of the data in a stream file that you are uploading into the Db2 table.

First of all, to correct a misunderstanding.Ī Format Description File has nothing at all to do with the format of a Db2 table.
