View previous topic :: View next topic |
Author |
Message |
Kumar Beginner
Joined: 28 Jul 2003 Posts: 1 Topics: 1
|
Posted: Mon Jul 28, 2003 10:54 am Post subject: Abend in 5000 records |
|
|
A batch job is updating a table.While updating a table an abend occured, at the time of abend the job updated 5000 records. After the fix, the job should start update from 5001 record. Can any one help me how to slove this problem. _________________ A batch job is updataing a Db2 table,while updating a abend occur , actually the job updated 5000 records, once the abend corrected it job should update 5001 record. Can any one help how to update this |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Mon Jul 28, 2003 11:06 am Post subject: |
|
|
To do a restart you add a statement to your SQL using a compare against your key fields (KEY1 > :KEY-FIELD). The cursor used to select the records to update must use ORDER BY as well. In this compare for a normal run, the value compared must be spaces, but if a restart happens, you replace the spaces in the variables with the key field of the last record processed. HTH. |
|
Back to top |
|
|
Anovice Beginner
Joined: 18 Feb 2004 Posts: 12 Topics: 2
|
Posted: Mon Feb 23, 2004 3:50 am Post subject: |
|
|
To have the restart logic you need to store the key field of your table in a separate table or file. You have to keep doing this every say 1000 records or so. Also you have to do a commit after every 1000 records. After an abend when you want to restart you have to read the last key from the table or file and restart from there. Howver, there are complications when you have your program writing to an output file. You have to fist to read till the last commit point in your output file and then start writing from there on. This is still more complex when you are writing a report file with headers, sub headers, sub totals etc. |
|
Back to top |
|
|
RobertL Beginner
Joined: 18 Nov 2003 Posts: 22 Topics: 0 Location: Lisbon, Portugal
|
Posted: Wed Feb 25, 2004 12:20 pm Post subject: |
|
|
You may be making an assumption that the program is issuing a commit after every n number of updates. When an abend occurs, DB2 will roll back to the point of last commit. Restart logic should then restart at that point.
Regards,
Robert |
|
Back to top |
|
|
|
|