View previous topic :: View next topic
|
Author |
Message |
devidas-patil
New User
Joined: 08 Jan 2007 Posts: 54 Location: pune
|
|
|
|
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 |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
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 |
|
|
pingte
Active User
Joined: 03 Dec 2005 Posts: 120 Location: india
|
|
|
|
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 |
|
|
kussu Warnings : 1 New User
Joined: 16 May 2007 Posts: 33 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Ace
New User
Joined: 03 May 2007 Posts: 14 Location: Delhi
|
|
|
|
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 |
|
|
anv2005
New User
Joined: 14 Jul 2005 Posts: 44 Location: US
|
|
|
|
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 |
|
|
|