Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Restarting in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
AADHAV KRISHNA

New User


Joined: 07 Aug 2012
Posts: 6
Location: India

PostPosted: Thu Aug 23, 2012 2:12 pm    Post subject: Restarting in JCL
Reply with quote

Hello all,
consider a requirement as follows,
In a job, say there are two steps, in step1, a cobol program has been called which compares 2 files and generates a file only if there is some difference between the records.
step2, will check whether the generated file is empty or not, if it has some records, it restarts the job.
once the job is restarted and the step2 executes in same fashion except that it should abend the job instead of restarting.
so is there any way to capture whether the job has been restarted?
or else I have to create a step before step1, which allocates a PS file and writes a counter into it, by checking the counter in step 2, I can achieve the logic!!!!!
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Aug 23, 2012 2:22 pm    Post subject:
Reply with quote

Atleast I am not aware off

How do you restart the job from a step icon_eek.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 23, 2012 2:29 pm    Post subject:
Reply with quote

In REXX you could do something like this :

execute cobol pgm
check if file empty
if not reexecute cobol pgm
check if file empty
if not terminate abnormally (abend or rc > 0)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 23, 2012 2:52 pm    Post subject: Reply to: Restarting in JCL
Reply with quote

The whole thing is a bit silly from what you have described. If the data remains the same, you'll get the same result the second time. So, what have you failed to mention...?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Aug 23, 2012 3:07 pm    Post subject: Re: Restarting in JCL
Reply with quote

AADHAV KRISHNA wrote:
step2, will check whether the generated file is empty or not, if it has some records, it restarts the job.
once the job is restarted and the step2 executes in same fashion except that it should abend the job instead of restarting.
What is this saying or asking, specially the bold-text? RESTART, in a JCL Forum, has a specifc meaning. I'm sorry but what does RESTART mean to you, in the context of your question and in JCL part of the Forum?
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Thu Aug 23, 2012 3:59 pm    Post subject:
Reply with quote

As Bill as said, the whole thing seems a bit odd. But would the simplest approach not be -

Step 1 - Cobol program
Step 2 - Compare - set return code if (not) different
Step 3 - Cobol program executes conditionally based on return code
Step 4 - Compare - abend job if different

rather than trying to restart the job and then apply some different logic on the second run.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Aug 23, 2012 7:45 pm    Post subject: Reply to: Restarting in JCL
Reply with quote

we all 'are missing' and I guess we all are anxiously waiting for the draconian/historical reply ...

that' s the requirement icon_cool.gif
Back to top
View user's profile Send private message
AADHAV KRISHNA

New User


Joined: 07 Aug 2012
Posts: 6
Location: India

PostPosted: Fri Aug 31, 2012 7:28 am    Post subject: Reply to: Restarting in JCL
Reply with quote

Thanks all for responding!!!!! thanks david followed ur algorithm, it works!!!!!!
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Aug 31, 2012 9:50 am    Post subject:
Reply with quote

Thanks for coming back and telling us what worked for you, appreciate it.

Good Luck!
Back to top
View user's profile Send private message
Dale Robertson

New User


Joined: 21 Jun 2013
Posts: 44
Location: U.S.A.

PostPosted: Wed Jun 26, 2013 2:03 am    Post subject: Simple is Better
Reply with quote

David Robinson,

Your approach is precisely what came to mind the moment I read the requirement.

r

Economics is what you already know made difficult.
--Wounded Eagle's Law
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Refreshing Continous running program ... Stefan CICS 1 Mon Nov 21, 2011 11:29 am
No new posts Problem with restarting a job in CA7 Nic Clouston CA Products 2 Sat Oct 08, 2011 5:43 pm
No new posts restarting a step which has condition... anjoos20 Mainframe Interview Questions 7 Mon Sep 06, 2010 3:42 pm
No new posts a question on restarting steps in jcl. Mukesh Pandey JCL & VSAM 13 Mon Feb 01, 2010 11:58 am
No new posts TCP LISTENER program not restarting p... ManojLenkaMainframes CICS 9 Thu Oct 08, 2009 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us