Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COND Parameter in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: COND Parameter in JCL
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: 1504
Location: Chennai

PostPosted: Thu Jan 20, 2011 12:35 pm    Post subject:
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: 1504
Location: Chennai

PostPosted: Thu Jan 20, 2011 12:37 pm    Post subject:
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    Post subject: Reply to: JCL COND Parameter
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 20, 2011 6:33 pm    Post subject:
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Thu Jan 20, 2011 6:50 pm    Post subject:
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    Post subject:
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    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 JTS parameter Shashank Chaubey JCL & VSAM 2 Thu Jul 13, 2017 4:15 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm
No new posts Execessive parameter issue Sumeendar JCL & VSAM 5 Mon Dec 19, 2016 4:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us