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

Restarting a COBOL program without using the JCL


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

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Mon Jan 29, 2007 4:00 pm
Reply with quote

I need to restart the COBOL program with out using the JCL?
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Jan 29, 2007 5:23 pm
Reply with quote

RESTART a COBOL PGM. without using a JCL icon_eek.gif ? , 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
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Mon Jan 29, 2007 6:33 pm
Reply with quote

YES Exactly
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: Mon Jan 29, 2007 9:02 pm
Reply with quote

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.
Quote:
YES Exactly

does NOT meet the request from Thamilzan
Quote:
after some 25th line or so ... please be more clear
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Tue Jan 30, 2007 9:35 am
Reply with quote

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
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Tue Jan 30, 2007 10:41 am
Reply with quote

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
View user's profile Send private message
mani_jnumca

New User


Joined: 18 Jan 2006
Posts: 16
Location: PUNE

PostPosted: Tue Jan 30, 2007 11:39 am
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Jan 30, 2007 3:08 pm
Reply with quote

The Entry maybe it's an option... but How can you Run/Restart a job in BATCH without JCL? icon_question.gif
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: Tue Jan 30, 2007 8:17 pm
Reply with quote

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
View user's profile Send private message
kshalini

New User


Joined: 20 Feb 2007
Posts: 8
Location: Banglore

PostPosted: Tue Feb 20, 2007 3:52 pm
Reply with quote

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
View user's profile Send private message
smiley
Warnings : 1

New User


Joined: 08 Feb 2006
Posts: 27

PostPosted: Wed Feb 21, 2007 1:06 pm
Reply with quote

do checkpoint work for this?

correct me if i am wrong.
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 Feb 21, 2007 7:56 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Feb 21, 2007 8:56 pm
Reply with quote

And even if you want to use restart you still need JCL.
Back to top
View user's profile Send private message
kshalini

New User


Joined: 20 Feb 2007
Posts: 8
Location: Banglore

PostPosted: Thu Feb 22, 2007 9:15 am
Reply with quote

Is there no way we can put a restart condition within the Cobol program.
What is checkpoint can any1 explain
Back to top
View user's profile Send private message
DeepaBala

New User


Joined: 20 Feb 2007
Posts: 13
Location: Trivandrum

PostPosted: Thu Feb 22, 2007 10:07 am
Reply with quote

s I also want to know what is checkpoint and what is that 'ENTRY' STATEMENT ?
icon_question.gif
Back to top
View user's profile Send private message
neeteen

New User


Joined: 25 Sep 2006
Posts: 2

PostPosted: Thu Feb 22, 2007 7:17 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 22, 2007 8:43 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
DeepaBala

New User


Joined: 20 Feb 2007
Posts: 13
Location: Trivandrum

PostPosted: Tue Feb 27, 2007 11:39 am
Reply with quote

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
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 Using API Gateway from CICS program CICS 0
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
Search our Forums:

Back to Top