View previous topic :: View next topic
|
Author |
Message |
ksathishkumar83
New User
Joined: 21 Nov 2006 Posts: 50 Location: India
|
|
|
|
I need to restart the COBOL program with out using the JCL? |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
RESTART a COBOL PGM. without using a JCL ? , Satish do u mean to say that, if there are 100 lines of code in u r cobol pgm u want to restart the execution of the program after some 25th line or so ... please be more clear
Cheer's
Thamilzan. |
|
Back to top |
|
|
ksathishkumar83
New User
Joined: 21 Nov 2006 Posts: 50 Location: India
|
|
|
|
YES Exactly |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How do you plan on running the program without jcl?
If you want the program to have a "smart" restart capability, you will have to provide it in the COBOL code. You can pass a parm telling the code where to "restart" or you can create a log of what has been successfully processed to be checked at "restart".
Any way you do it, you will still need jcl.
If this does not sound like what you need, provide a more clear description of what you want to do.
does NOT meet the request from Thamilzan
Quote: |
after some 25th line or so ... please be more clear |
|
|
Back to top |
|
|
ksathishkumar83
New User
Joined: 21 Nov 2006 Posts: 50 Location: India
|
|
|
|
I want to restart the program from where it has stopped.
Suppose there are 50 lines .The job has abended in 20 line.I want to restart the program from 21st line. |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Satish,
As far as COBOL is concerned u CANNOT restart the execution of the program from the middle (From 20th line as u have quoted), It is possible in CICS during Pseudo-Conversation technique( That too the program starts executing from the start but would look like it is executiong from the middle), Now I am a bit curious to know where do u need such requirement in your project or training.
Cheer's,
Thamilzan. |
|
Back to top |
|
|
mani_jnumca
New User
Joined: 18 Jan 2006 Posts: 16 Location: PUNE
|
|
|
|
there is one statement ENTRY
which might work for that condition
the "ENTRY" specify the another entry point for
the cobol program
i am not sure about it but it might be........ |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
The Entry maybe it's an option... but How can you Run/Restart a job in BATCH without JCL? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Ksathishkumar83,
As you can see from the replies to your question, what you say you want do do is not available - batch jobs DO use jcl and (if not provided in the design/code) there is no way to "start in the middle".
Let's say your program abended in line 20. Let's also say it abended after processing 9,345 records completely and was working on record 9,346. How would that restart in line 21 work? What about the output that had been generated for the records up to the time of the abend (files, database tables, reports, etc)?
If you post what you need to do (with data examples and what should happen in your process) and not how you'd like to do with it, we may be able to offer better suggestions. |
|
Back to top |
|
|
kshalini
New User
Joined: 20 Feb 2007 Posts: 8 Location: Banglore
|
|
|
|
same question was asked to me in an interview where the guy asked me
that suppose a cobol program is reading a vsam and it abends now you dont want it to start from the beginning because it will again take lot of time how will you do it i.e how to put a restart logic within the cobol program |
|
Back to top |
|
|
smiley Warnings : 1 New User
Joined: 08 Feb 2006 Posts: 27
|
|
|
|
do checkpoint work for this?
correct me if i am wrong. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Checkpoint is a good thing, but the restart needs to be designed in when the system is developed - not when a restart is needed. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
And even if you want to use restart you still need JCL. |
|
Back to top |
|
|
kshalini
New User
Joined: 20 Feb 2007 Posts: 8 Location: Banglore
|
|
|
|
Is there no way we can put a restart condition within the Cobol program.
What is checkpoint can any1 explain |
|
Back to top |
|
|
DeepaBala
New User
Joined: 20 Feb 2007 Posts: 13 Location: Trivandrum
|
|
|
|
s I also want to know what is checkpoint and what is that 'ENTRY' STATEMENT ?
|
|
Back to top |
|
|
neeteen
New User
Joined: 25 Sep 2006 Posts: 2
|
|
|
|
Hi,
For file status 39 ie attribute mismatch,chaeck the LREC of file in JCL and in COBOL Pgm.
Now for the RESTART LOGIC, although I am not very sure about it but I have one idea.
lets say reading a VSAM KSDS File and after reading 100th record it abended at 101th record....then.....the program design should be like.
creat a temp sample file which will have dummy record (ie 0 , 0) for the key field and count field.Now in the first para, read this sample file record, and in second para read KSDS dynamically with key is greater than the key value in sample file.
as per the scenario if it abend at 101 record, it means the file status would not be 0 or 10 so based on this condition first move this 101th record with key value in sample file with occurence,then go to first para again where it will read the last record from sample file which is 101th record and it will again proceed to second para where we are reading KSDS dynamically with key is greater than key value in sample file so it will read whole file excluding wrong records till file status is 10.
I have never coded it,but It might work.
correct me If I am wrong. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Checkpoint is a command that marks the end of a logical-unit-of-work (LUW). Checkpoint is issued in COBOL programs.
ENTRY is a way to have multiple places in your code to begin execution. When you execute a program (process an EXEC PGM= statement or call it from another program), the execution typically begins at the "top" of the program and runs until control is returned to the caller or the operating system.
Using ENTRY, a program can be "started" at other than the top. Rather than having multiple entry points, nearly ALL applications process a PARM or other input control data to handle a restart.
I personally do not recommend ENTRY for implementing restart logic.
We can do many tings, this doesn't mean we should do them |
|
Back to top |
|
|
DeepaBala
New User
Joined: 20 Feb 2007 Posts: 13 Location: Trivandrum
|
|
|
|
Hi friends..
I collect a information about Checkpoint in IBM Library...
But I am not able to understand what they said.. I attach the copy of that page with this.
Please can any one explain me. |
|
Back to top |
|
|
|