Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL steps skipped on Restart due to IF condition

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

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Mon Jul 09, 2012 8:19 am    Post subject: JCL steps skipped on Restart due to IF condition
Reply with quote

All,
I came across a situationa as follows for the first time -
Here is sample JCL -
STEP1 EXEC FILEMGR

IF STEP1.RC=0

EXEC STEP2
EXEC STEP3 - BMP
EXEC STEP4

ENDIF

EXEC STEP5

My job abended in STEP3. When I did a step restart, it skipped STEP3 and STEP4 with an explanation that these steps are not executed due to condition code coded on line XYZ which is STEP1.RC=0. It was inside the IF already at time of abend !!
Only STEP5 was executed.

Is this how IF is supposed to behave, did it loose the RC of STEP1 while it abended.[/code]
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 09, 2012 8:35 am    Post subject:
Reply with quote

Have you read the JCL Reference manual on restarts and the IF statement? It specifically states that only automatic restarts retain condition information, and since you did a step restart instead of an automatic restart, I expect that the behavior you saw is precisely what would be expected of the system.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jul 09, 2012 9:19 am    Post subject:
Reply with quote

Hello,

When you step restarted the job, there were NO return codes available for any of the steps prior to the restart. This is possibly the biggest problem with using "IF" to check return codes. . .

As Robert mentioned, you need to invest time learning about restart and IF from the JCL Reference Manual (available via the "IBM Manuals" link at the top of the page).
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Jul 09, 2012 4:18 pm    Post subject:
Reply with quote

What you asked system to do is "deferred Restart" and not an "automatic restart" as Robert has talked about it.

IF STEP1.RC=0 "tests false" because STEP1 did not execute and cannot be correctly evaluated. You should have changed the IF as
Code:
IF STEP1.RC=0 | ¬STEP1.RUN THEN

EXEC STEP2
EXEC STEP3 - BMP
EXEC STEP4

ENDIF
EXEC STEP5
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 BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us