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

COND Parameter in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prashant Sharma

New User


Joined: 26 May 2008
Posts: 8
Location: india

PostPosted: Thu Jan 20, 2011 12:25 pm
Reply with quote

I faced a problem with JCL COND parameter. Though, I resolved the problem, however need to confirm my understanding.

In the below suggested JCL.

JOBSTEP1 - runs with RC=04, which made JOBSTEP2 - as non-executable.
JOBSTEP3 is checking RC of JOBSTEP3 for GO-NO-GO.

So, what will happen with JOBSTEP3 ? Will it execute ? If yes, then what will be the RC value set by JOBSTEP2 ?


Code:
//JOB CARD
//*
//JOBSTEP1      EXEC PGM=XYZ
//*
//JOBSTEP2      EXEC PGM=ABC,COND=(4,EQ)
//*
//JOBSTEP3      EXEC PGM=EFG,COND=(4,EQ,JOBSTEP2)
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jan 20, 2011 12:35 pm
Reply with quote

Hi,

The third step will execute, The COND=(4,EQ,JOBSTEP2)
is the condition which will stop execution of the step and this condition is false, so the third step executes.

The jobstep2 gets flushed so I think there is no RC for that step.

hope it helps.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jan 20, 2011 12:37 pm
Reply with quote

Tested icon_smile.gif

Code:
//DUMYSTEP EXEC PGM=IEBGENER                             
//SYSPRINT DD SYSOUT=*                                   
//SYSIN    DD DUMMY                                     
//SYSUT1   DD DATA,DLM='$$'                             
/*REXX*/                                                 
 SAY 'HI'                                               
 EXIT 4                                                 
$$                                                       
//SYSUT2   DD DSN=&&TEMP(TESTIT),DISP=(NEW,PASS,DELETE),
//          UNIT=SYSDA,SPACE=(TRK,(1,1,20),RLSE),       
//          DCB=(BLKSIZE=6160,LRECL=80,RECFM=FB,DSORG=PS)
//*                                                     
//JOBSTEP1 EXEC PGM=IKJEFT1A,DYNAMNBR=200               
//SYSPROC  DD DSN=&&TEMP(TESTIT),DISP=(OLD,DELETE,DELETE)
//SYSPRINT DD SYSOUT=*                                   
//SYSTSPRT DD SYSOUT=*                                   
//SYSTSIN  DD *                                         
%TESTIT                                                 
/*                                                       
//JOBSTEP2 EXEC PGM=IEFBR14,COND=(4,EQ)                 
//JOBSTEP3 EXEC PGM=IEFBR14,COND=(4,EQ,JOBSTEP2)


the JOBSTEP1 returns RC of 4.

Output:

Code:
STEPNAME PROCSTEP    RC   EXCP
DUMYSTEP             00     43
JOBSTEP1             04     39
JOBSTEP2          FLUSH      0
JOBSTEP3             00      8   


Hope it helps.
Back to top
View user's profile Send private message
Prashant Sharma

New User


Joined: 26 May 2008
Posts: 8
Location: india

PostPosted: Thu Jan 20, 2011 6:23 pm
Reply with quote

Thanks Vasanthz.
However, I wanted to know, against which RC Value COND in JOBSTEP3 is comparing? Is there any default value, in this case which is Not Equal to '4' ?

Thanks.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 20, 2011 6:33 pm
Reply with quote

It is comparing against the job step that YOU have specified in the JCL that it should check against

Time to read / re-read the manual I think
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: Thu Jan 20, 2011 6:50 pm
Reply with quote

From chapter 16.5 of the JCL Language Reference manual (link at the top of the page):
Quote:
The system performs the COND parameter tests against return codes from the current execution of the job. If a test specifies a previous step that was bypassed, the system evaluates the COND parameter as false.
Since the job step for the JOBSTEP3 condition code test was flushed, there is no comparison done -- the COND is just set to FALSE, period.
Back to top
View user's profile Send private message
Prashant Sharma

New User


Joined: 26 May 2008
Posts: 8
Location: india

PostPosted: Thu Jan 20, 2011 7:59 pm
Reply with quote

Thanks a lot Rob and Expat!!!
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 Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
Search our Forums:

Back to Top