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

Difference in mentioned the COND parameter in job and step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
namashlr
Currently Banned

New User


Joined: 27 Aug 2006
Posts: 5

PostPosted: Sun Oct 01, 2006 4:38 pm
Reply with quote

What is the condition checking flow, and difference in mentioned the cond in job and step.
(pls dont give the answer job will override step)
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Sun Oct 01, 2006 8:56 pm
Reply with quote

Hi Namshr,

COND - Each step sends an a return code to the system upon completion.
This is called condition code. COND parameter is used to control
the execution of subsequent job steps, depending on the condition
code that is returned for prior step.

Return code number between 0 and 4095


Syntax -> COND=(comparsion-code,condition)
(If coded on job)

COND=(comparsion-code,condition [,stepname] [,EVEN / ONLY])
(If coded on step)

condition can be GT,GE,LT,LE,EQ,NE



Example JCL -> COND coded on JOB

//MYJOB JOB (R475),'KRISHNA REDDY'
// COND=(4,GT)
//STEP1 EXEC PGM=COBPROG
//STEP2 EXEC PGM=COBPROG2

In this example we are specifing that if the number
4 is grater than the return code of STEP1, then STEP2
is to be bypassed. It is elaborated further in the
following image




COND coded on EXEC statement

//MYJOB JOB (U769),'KRISHNA REDDY'
//STEP1 EXEC PGM=PROG1
//STEP2 EXEC PGM=COBPROG,
// COND=(8,EQ,STEP1)
//

In this example the COND parameter is used to specify that
STEP2 should be by passed if 8 is equal to the return code
issued by STEP1.
Back to top
View user's profile Send private message
rocksolid

New User


Joined: 29 Aug 2006
Posts: 21
Location: India

PostPosted: Tue Oct 03, 2006 10:46 am
Reply with quote

In addition to Ekta,

COND parameter coded in JOB statement overrides the one in EXEC statement.

Ex:

//MYJOB JOB (U769),'KRISHNA REDDY'
// COND=(4,GT)
//STEP1 EXEC PGM=PROG1
//STEP2 EXEC PGM=COBPROG,
// COND=(8,EQ,STEP1)
//STEP3 EXEC PGM=PROG2,
// COND=(4,LE,STEP2)
//

If 4 is > the return code of step1, then STEP2 and STEP3 won't be executed. Else COND parameter in EXEC will be checked.

Thank U,
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Timestamp difference and its average ... DB2 11
Search our Forums:

Back to Top