View previous topic :: View next topic
|
Author |
Message |
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
|