Issuing a checkpoint
A checkpoint must be issued after one or more Logical Units of Work (LUW). This ensures that related data is COMMITted or backed out together, so data remains consistent in the event of an ABEND. It also provides a simple method for “getting back on track” when a restart is attempted; namely by entering the program from the top and processing the next LUW. See Examples-of-the-Logical-Unit-of-Work-implementation for more information.
Initialize CKPT-REQUEST-TYPE with a value of either a SPACE, an 'F', or a 'W'.A SPACE signifies a request for a “Normal checkpoint”, while an 'F' signifies a request for a “Forced checkpoint”. The 'W' is a special request which asks the question “If I had really been PERFORMing CKPT-RTN with a normal checkpoint request, would it have taken a checkpoint?”. Option 'W' will never take a checkpoint, but will increment the counter towards achieving the CKPTFREQUENCY. The 'W' request type will cause the CKPT-TAKEN-FLAG to be set to 'W' if a checkpoint WOULD HAVE BEEN TAKEN, or 'N' if one would not have been taken.
“Normal checkpoint” requests result in the execution of the logic to determine whether or not an adequate amount of time and an adequate number of iterations have occurred since the previous checkpoint before actually processing the checkpoint and issuing any necessary DBMS checkpoints or COMMITs. This takes into account the contents of the CKPT-FREQUENCY field. The checkpoint frequency is discussed in Execution Requirements.
“Forced checkpoint” requests override all other criteria, and always result in the imperative execution of a checkpoint, and will always issue all appropriate DBMS checkpoints or COMMITs.
The ‘W’ request type can be used when the application needs to perform special activities just prior to an actual checkpoint to complete its LUW.
At the end of an application program's Logical Unit of Work, in lieu of issuing a direct CALL to the Host DBMS for a checkpoint or COMMIT, issue the COBOL “PERFORM” Verb to execute the QUICKSTART routine CKPT-RTN, using the following syntax:PERFORM CKPT-RTN.
Following a “CALL” to the Checkpoint Routine from within CKPT-RTN, the application program can interrogate the contents of the field CKPT-TAKEN-FLAG. If this field contains the value of 'Y', QUICKSTART is informing the application program that an actual checkpoint has been issued. The application program should then take any appropriate post-checkpoint activity, such as re-establishing DBMS positionings (e.g. required in IMS).
IF CKPT-TAKEN-FLAG = 'Y'
(perform any tasks the DBMS requires after a COMMIT, such as Database repositioning, if this is a requirement of the DBMS)
END-IFIf, during the execution of CKPT-RTN, no checkpoint was actually taken, QUICKSTART places the value 'N' in the CKPT-TAKEN-FLAG field.
Related topic