Restart logic (Checkpoint logic)

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
sreekanth bodke
Member
Posts: 2
Joined: Mon Oct 11, 2010 1:48 pm
Location: Bangalore

Restart logic (Checkpoint logic)

Post by sreekanth bodke » Mon Oct 11, 2010 3:48 pm

hi,

I was wondering about the 'Restart logic' that how it works!! importantly about the CKPT_TABLE entry, Buffer-pool and what will this 'Checkpoint logic' will refer while it is getting restarted? i mean, whether it will refer to input file or buffer pool?

Please clarify me about all these queries...
let me know if anybody didnt understand these questions...
Sreekanth bodke

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Oct 11, 2010 4:19 pm

each site has its own method of restart.
you need to speak to your support group or co-workers
to find out how restart procedures are implemented at your site.

i have worked a many sites and each had its own process.

also, do a search of this website, this topic has been discussed before.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

sreekanth bodke
Member
Posts: 2
Joined: Mon Oct 11, 2010 1:48 pm
Location: Bangalore

Post by sreekanth bodke » Wed Oct 13, 2010 3:34 pm

hi Dick,

First of all thanks for your response for my question.

i would like to make the topic clear for you.

Actually i have coded a cobol program which includes the chekpoint logic.
The jcl which runs for this program will unload records from some table
and store the data into one flat file. This file is used as input to the
program. The program will just read this input flat file and writes into outfile
flat file specified in the jcl.

After the unload is done, the input provided to the program has 333
records. when the program is running, if it abends at 50th record, the
checkpoint logic what am using in my program will help in capturing the
record which was processed succesfully just before the abend happened(
we specify something known as FREQUECY as an input to the checkpoint
logic i.e., FREQ(002) as an example). so an entry will be made in a table
called CKPT-TABLE i.e., 48th record is captured in this table as per the FREQ
(002) as an example.

so when we RESTART the program after solving the problem in the 50th
record which caused the abbend in the program, the program will run from
49 record.( the FREQ(002) does means that for every two records we are
COMMIT'ing the CKPT-TABLE to capture that record. i.e., when processing,
everying 2nd record in captured in the table for eg: when program picks up
2nd record it is saved in the table, again when it comes to 4th record, the
2nd record is replaced by 4th record in the CKPT_TABLE. similarly the 48th
was stored in the table!!).

My question is, when we restart the program how the checkpoint would
come to know that it has to start from 49th record!!?

as per i referred to some document, after every COMMIT the records will
be stored in something called as DB2-BUFFER-POOL'. as per the above
example i have shared, 48th record was commited and all those 48
records would be stored in BUFFER_POOL. the records wouldn't be written
to output file specified in the jcl untill all the 333 records got processed
successfully, untill then the records would go on stored in the buffer pool.

so how the chekpoint logic wil come to know that it has to start from 49th
record, whether it will refer the BUFFER POOL or INPUT FILE while getting
restart?


Sorry if have made u feel bore by giving lot of explanation. :)
i want to know how it works.

Please help.
Sreekanth bodke

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Oct 13, 2010 5:00 pm

sorry, what you have explained is very confusing and does not make any sense,
regardless of how I substitute proper terminology.

first thing,
files have record, fields
db2 has rows, columns.

if you intermix the terms I will not even bother to try to help.

Second,
your restart row contains an image of the last successful input record processed.
that means you open your input file and compare each record until you find a match,
and then start your processing with the next input record.

a comment:
it would be easier and more efficient to store a counter of records processed,
then you would just perform a read of the input file counter number of times,
and save comparing on each record with the image.
end comment

every second input record processed is COMMITed to the restart table
at the same time those output rows are being COMMITed.

a program abend (which would cause a rollback)
would remove any output rows since the last commit.

thus, your input and output would be insync.

DB2 Bufferpool is a technical term
the same as record buffer.
the data is stored there until it is written to disc.
as far as i am concerned, an irrelevant and confusing term to use in a document
about restart procedures. - but that is personal opinion.

your will never read/access the bufferpool in deciding the restart point.
this buffer pool
(a term that some inflated ego decided to use in the document)
is (per your explanation) the output storage area, not an input storage area.

i have seen much better implementations of this type of restart procedure,
but it will work.

restart starts at the 49th, because the last good processed was 48th.
and because checkpoint table and output rows are COMMITed at the same time,
the last output row will also be the 48th.
thus when you start with the 49th, it will also create the 49th output.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others