IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can anybody tell me what is retsart logic in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
devidas-patil

New User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Wed May 30, 2007 9:56 am
Reply with quote

Hi
please can anybody tell me the restart logic in cobol

i just got this question in interview and i dont know about what he asekd me but one thing is sure he asked me the restar logic in cobol
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Wed May 30, 2007 10:44 am
Reply with quote

It is coded in the job card and I think it means to restart a job
from the step specified on the job card in case of an abend.

Why don't you surf around and look it up?
=)
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Wed May 30, 2007 12:02 pm
Reply with quote

In normal COBOL programs there is nothing like restart logic.

Either restart in done through JCL or in IMS COBOL program.

In JCL you can specify the step name which you want to restart in job card. If you are using cataloged procedure, then specify procname.stepname to restart.

In Cobol IMS program you can use, the checkpoint logic to restart a program.

CALL 'CBLTDLI' USING CHKP ...... to set check point

And at begining of program (i.e. b4 using any CHKP call) issue a RESTART call.
CALL 'CBLTDLI' USING XRST... to restart the program in case of any abends
Back to top
View user's profile Send private message
kussu
Warnings : 1

New User


Joined: 16 May 2007
Posts: 33
Location: India

PostPosted: Wed May 30, 2007 8:44 pm
Reply with quote

As per my knowledge, the interviewer is asking about general logic used to restart from a particular record of the file in Cobol.

In general we can explain this case as:-

Let us say if a file[which is a DB2 table] contains 100 records which needs to be updated,

This restart logic will work as:-

For hundred records , lets say we will commit the modifications for each and every 10 records.

While updating the first 10 records, if 10th record got abended, that record will be moved to the restart file [Which we declared for this purpose].

And the record present in the restart file will be compared with the input file, until these two are matching

when the matching record found, the program will start updations from that record .

Like this it will work..!

This is as per my knowledge....Let me know if I am wrong

Thanks
Kussu
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 30, 2007 8:53 pm
Reply with quote

Hello,

It is quite common for a long-running batch cobol program to have restart logic built in.

The restart logic in the cobol code is syncronized with database checkpoints and re-creating/re-positioning sequential output files and reports.

Usually, restarts are performed by "logical units of work" (LUW) rather than at each specific input record.
Back to top
View user's profile Send private message
Ace

New User


Joined: 03 May 2007
Posts: 14
Location: Delhi

PostPosted: Wed May 30, 2007 11:27 pm
Reply with quote

Hi,

The RESTART LOGIC in a cobol program is to restart your operation from where the last abend happened in the program

For e.g. If you have 2 files and you r reading 1 file and writing into the another file and say at 30th record, any abend happens then that record will be moved to BISRESTARTER (dataset in Unisys Mainframe) and when you restart executing your program it will get the record in the BISRESTARTER and you have to position the pointer to your 30th record and will start reading from that point and write that to output file.
Back to top
View user's profile Send private message
anv2005

New User


Joined: 14 Jul 2005
Posts: 44
Location: US

PostPosted: Thu May 31, 2007 12:38 am
Reply with quote

Hi Ace,

You wrote:
Quote:
The RESTART LOGIC in a cobol program is to restart your operation from where the last abend happened in the program


I would also add that the RESTART logic in any programs must include logic to re-process any failed unit of work. The failed unit of work is usually completes with DB2 ROLLBACK, Web MQ MQBACK or RRS SRRBACK call.

Any application program must ensure that its resources, i.e. working-storage contents, sequential file positions and random file updates must be in sync with database managed resources at all times.

Regards,
Alex.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top