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

Restarting in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Aug 23, 2012 2:22 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 23, 2012 2:29 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 23, 2012 2:52 pm
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

Superior Member


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

PostPosted: Thu Aug 23, 2012 3:07 pm
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: 199
Location: UK

PostPosted: Thu Aug 23, 2012 3:59 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Aug 23, 2012 7:45 pm
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
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

Superior Member


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

PostPosted: Fri Aug 31, 2012 9:50 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts self-restarting jobs in OPC IBM Tools 1
No new posts Refreshing Continous running program ... CICS 1
No new posts Problem with restarting a job in CA7 CA Products 2
No new posts restarting a step which has condition... Mainframe Interview Questions 7
No new posts a question on restarting steps in jcl. JCL & VSAM 13
Search our Forums:

Back to Top