CHKPT and COMMIT in cobol-IMS pgm.

How to create chkpnt and commit in IMSDB-ocobol PGM.?

Questions by vardhan.frd   answers by vardhan.frd

Showing Answers 1 - 3 of 3 Answers

This Checkpoint/Restart logic is for the commit for the 100 ISRT/DLET IMS calls.

In Data Division first we need to give both restart length and checkpoint length as below.

01 RESTART-SEGMENT-LENGTH PIC S9(005) COMP VALUE +0 .
01 CHKPT-SAVE-LENGTH PIC S9(005) COMP VALUE +0 .

Then need to give the restart work area as below.This should be Spaces before the XRST call.

01 RESTART-WORKAREA.
05 RESTART-CHKPTID.
10 RESTART-CHKPT-AREA1 PIC X(04) VALUE SPACE .
10 RESTART-CHKPT-AREA2 PIC X(04) VALUE SPACE .
05 RESTART-FILLER PIC X(04) VALUE SPACE .

Then Give the Checkpoint Identifier in Checkpoint workarea.

01 CHECKPOINT-WORKAREA.
05 CHKPT-WORKAREA.
10 CHKPT-PREFIX PIC X(04) VALUE S950 .
10 CHKPT-ID-CNTR PIC 9(04) VALUE ZERO .
05 CHKPT-FILLER PIC X(04) VALUE SPACE .

Then give the Checkpoint save area.

01 CHECKPOINT-SAVE-AREA.
05 PROGRAM-ID PIC X(008) VALUE PROGRAM .
05 NOOF-INSERTS PIC 9(007) VALUE ZERO .
05 NOOF-DELETS PIC 9(007) VALUE ZERO .

In the procedure division

Get the length of Restart and Checkpoint areas.
MOVE LENGTH OF RESTART-WORKAREA TO
RESTART-SEGMENT-LENGTH.

MOVE LENGTH OF CHECKPOINT-SAVE-AREA TO
CHKPT-SAVE-LENGTH.

Then give a XRST call initially for one time.In case of any problem all the value will store in workarea.

CALL CBLTDLI USING XRST
IO-PCB
RESTART-SEGMENT-LENGTH
RESTART-WORKAREA
CHKPT-SAVE-LENGTH
CHECKPOINT-SAVE-AREA.


Then take an initial checkpoint call.

CALL CBLTDLI USING CHKP
IO-PCB
RESTART-SEGMENT-LENGTH
CHECKPOINT-WORKAREA
CHKPT-SAVE-LENGTH
CHECKPOINT-SAVE-AREA.



Suppose the no: of DLET/ISRT calls are WORK-UNIT

Then After the successful DLET/ISRT call give as follows.

IF WORK-UNIT = 100
MOVE ZERO TO WORK-UNIT
ADD 1 TO CHKPT-ID-CNTR

CALL CBLTDLI USING CHKP
IO-PCB
RESTART-SEGMENT-LENGTH
CHECKPOINT-WORKAREA
CHKPT-SAVE-LENGTH
CHECKPOINT-SAVE-AREA.

This call will Commit the changes.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions