View previous topic :: View next topic
|
Author |
Message |
sureshmurali Warnings : 1 New User
Joined: 25 Nov 2010 Posts: 70 Location: Sivakasi, India
|
|
|
|
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 |
|
|
Dsingh29
Active User
Joined: 16 Dec 2008 Posts: 132 Location: IBM
|
|
|
|
Hi Suresh,
COND written in EXEC statement overrides on COND written in JOB stmt. |
|
Back to top |
|
|
parsesource
New User
Joined: 06 Feb 2006 Posts: 97
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|