The requirement is like I need to read records from file and update in the database.Each time I have to commit,as if the program abends then it will restart after the last record that had been updated in the database.
I need to impement this in my cobol program.Can any one let me know how to do it?how to put restart logic in cobol?
It will be helpful if any one get me some sample code or link of a sample code for cobol restart.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Restart/recovery are not a single-program issue. . .
If an organization uses this, it is already defined what is needed to be incorporated in application to participate in the restart/recovery. You should not "roll your own" method. You should use the already implemented process.
Many (most) organizations no longer put this into new programs being developed. It is typically less error prone and less time consuming to simply rerun from the beginning.
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
As Dick rightly said, there certainly should be some organization standard on how this is to be done...
Anyways, in case you have got a requirement like this, my suggestion would be to have a DATE-TIME field in the record when you are writing to the database. Using this field you could put the logic in your program based on your requirements and frequency of the program getting invoked.
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
Before you start with you need to know what is check-point restart. I'll try - Checkpoint/Restart allows you quickly insert COMMITs and CHECKPOINTS into your DB2 batch job streams – in some instances with- out even editing your programs. These COMMITs will often speed up DB2 batch programs and also free up DB2 resources for other production jobs that are running at the same time. After COMMITS are added to your DB2 batch programs, Checkpoint/Restart allows you to quickly restart any abended production job from the point of failure. Checkpoint/Restart will reestablish all positioning and resources within the problem program, including COBOL Working Storage and QSAM and VSAM file access; and then completes any remaining application processing rather than rerunning the whole DB2 program from the beginning.
Checkpoint Restart also provides a powerful Variable COMMIT Frequency Option that enables you to dynamically tune DB2 batch jobs by changing their COMMIT frequency as they run. Database Administrators can now dramatically speed up any jobs that need to be completed as soon as possible prior to the online DB2 applications being restarted.