GeekInterview.com
Series: Subject: Topic:
Question: 7 of 231

CHKPT and COMMIT in cobol-IMS pgm.

How to create chkpnt and commit in IMSDB-ocobol PGM.?
Asked by: vardhan.frd | Member Since Dec-2011 | Asked on: Apr 27th, 2012

View all questions by vardhan.frd   View all answers by vardhan.frd

Showing Answers 1 - 1 of 1 Answers
jithinraghav

Answered On : May 3rd, 2012

View all answers by jithinraghav

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.