1) My table contains 1 million of records.. while writing this record to a file if any error occurs at some 99000 record instead of doing roll back all records I have to restart from the 99000 record what is the restart logic for that in db2
===> ANSWER of this Que what i know is that
The logic will be handled by a restart file where we are going to make an entry for every commit and commit count will be given by us only..
If any abend occurs the process will start from the last committed record.
But i need actual coding that how to create restart file & how it will read after ABEND this file....
I Hoping that u understand my problem.....
what i understand from the query is that your table contains 1 million records and you want to write the records to the flat file and you want to avoid rollback.
okay. you are confused in your query. let me explain you.
the answer you gave is entirely different from the questions posted.
while inserting row in the table, if there is any invalid entry, then there is a ROLLBACK. where as in the case of writing the records from table to file you do not experience any ROLLBACK. we simpy unload the table to flat file using the unload card.
Unloading simply creates the copy of the records in the table, to a flat file. There is nothing like ROLLBACK during unloading.
whereas, while inserting the rows in the table we need to be caution about invalid keys which may result in ROLLBACK. in case of insertions we use the commit logic and restart pionts.
Go ahead and unload the table to flat file.