Page 1 of 1

How Can i Implement Checkpoint restart in DB2?

PostPosted: Mon Nov 09, 2009 12:38 pm
by akishore
Hi,
How can I implement checkpoint restart logic in DB2. The one similar in IMS?
I have an issue here - A Job that is doing database update got failed. But while restarting, I have given wrong GDG base and it has updated with yesterday's data. Luckely I have found it while checking the data.
Can someone help me to fix this? I need the Job to be abended if we use a wrong input file(GDG/Flat).
I dont have much experience in DB2. Can someone please help me?

Re: How Can i Implement Checkpoint restart in DB2?

PostPosted: Mon Nov 09, 2009 6:47 pm
by swd
The way I read this is that this is not a DB2 problem, but an application problem. If your application lets you process the same file twice, this is not DB2's fault. It sounds like you need some sort of method to check if a file has already been processed, and if it has you can make your program end with an error.

A common way of doing this, that I have seen, is a file 'run number' or file 'sequence number' that is in a file header record. When the file has been processed this number is stored somewhere (on a DB2 table). If the file is processed again it checks the file run number and if it is less than or equal to the one stored on the DB2 table, then the file has already been processed, so you can end you program with an error. If the file run number is +1 greater than the number stored on the DB2 table, then it's OK to process the file.

Re: How Can i Implement Checkpoint restart in DB2?

PostPosted: Tue Nov 10, 2009 12:35 am
by dick scherrer
Hello,

Implementing checkpoint will not help with this situation as this situation was caused by someone making a mistake. . . Checkpoint/restart is sometimes used to continue an abended run (not prevent setup errors). More and more this is not used because of the speed of the new cpus and dasd. Part of any restart/recovery/rerun is making sure that the proper data is in the database and the proper input(s) are used.

Nothing i know of can completely prevent people from making mistakes. Using something like Steve mentioned could help for syncronizing normal runs.

Re: How Can i Implement Checkpoint restart in DB2?

PostPosted: Thu Nov 12, 2009 8:17 pm
by akishore
Hi Thanks For the Help - I have used a VSAM file to store the latest file count. The issue has been solved now.