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
 
COND parameter in JOB CARD not override the COND in EXEC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: COND parameter in JOB CARD not override the COND in EXEC
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    Post subject:
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    Post subject:
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: 8167
Location: East Dubuque, Illinois, USA

PostPosted: Fri Mar 11, 2011 6:12 pm    Post subject:
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

Site Director


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

PostPosted: Fri Mar 11, 2011 8:59 pm    Post subject:
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    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 exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts JTS parameter Shashank Chaubey JCL & VSAM 2 Thu Jul 13, 2017 4:15 pm

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