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

COND parameter in JOB CARD not override the COND in EXEC


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sureshmurali
Warnings : 1

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Fri Mar 11, 2011 4:07 pm
Reply with quote

Code:
//xxxxxxK JOB (yyyy9331),'RUN',MSGCLASS=O,CLASS=A,   
//             NOTIFY=&SYSUID,REGION=2K,MSGLEVEL=(1,1),
//             COND=(0,NE)                             
//JOBLIB DD DSN=ABCDEF.xxxxxx.JCLLIB,DISP=SHR         
//STEP1 EXEC PGM=FCOMMUO1                             
//STEP2 EXEC PGM=FCOMMUO1,COND=(0,EQ)                 
//SYSOUT   DD SYSOUT=*                                 
//SYSPRINT DD SYSOUT=*   


Here Step1 returned RC = 0. we know that COND in Job card will override COND in EXEC.
As a result i expected the step2 will be executed as the COND parameter in the job card will override it. But the output i got is, step 1 only executed and not step 2. Please help me to understand the logic.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Fri Mar 11, 2011 4:14 pm
Reply with quote

Hi Suresh,

COND written in EXEC statement overrides on COND written in JOB stmt.
Back to top
View user's profile Send private message
parsesource

New User


Joined: 06 Feb 2006
Posts: 97

PostPosted: Fri Mar 11, 2011 4:25 pm
Reply with quote

Dsingh29 wrote:
Hi Suresh,

COND written in EXEC statement overrides on COND written in JOB stmt.


this is wrong. both are evaluated. the first step is always executed

jcl reference =>

If you code the COND parameter on the JOB statement and on one or more of the job's EXEC statements, and if a return code test on the JOB statement is satisfied, the job terminates. In this case, the system ignores any EXEC statement COND parameters.

If the tests on the JOB statement are not satisfied, the system then performs the return code tests on the EXEC statement. If an EXEC return code test is satisfied, the step is bypassed.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 11, 2011 6:12 pm
Reply with quote

As parsesource's quote from section 16.5.3 of the JCL Reference manual indicates, your job performed exactly as expected and documented.

1. STEP1 ran and had RC=0.
2. The JOB condition code was not met, so the job continued to run.
3. The step condition code was met, so STEP2 was not executed.
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: Fri Mar 11, 2011 8:59 pm
Reply with quote

Hello,

To continue the learning experience, i suggest you add a 3rd step to the job:
//STEP3 EXEC PGM=FCOMMUO1

Does this step run or is it bypassed? Why?
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
Search our Forums:

Back to Top