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
 
JCL COND CODE check

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
juares castro

New User


Joined: 04 May 2012
Posts: 25
Location: Brazil

PostPosted: Tue Jun 26, 2018 7:43 pm    Post subject: JCL COND CODE check
Reply with quote

Hi everyone!
(silly (?) question)
I am trying to prove some things I had as true.
I mean, in a job, the greatest COND CODE produced is the current one we have to compare. Please check the job I have ran checking COND CODE:
Code:

//CONDCOD1  EXEC PGM=IDCAMS                                             
//SYSPRINT  DD SYSOUT=*                                                 
//SYSIN     DD *                                                       
 SET MAXCC=5                                                           
//*                                                                     
//CONDCOD2  EXEC PGM=IDCAMS                                             
//SYSPRINT  DD SYSOUT=*                                                 
//SYSIN     DD *                                                       
 SET MAXCC=10                                                           
//*                                                                     
//*                                                                     
//CHECK001  EXEC PGM=IEFBR14,COND=(0,NE)                               
//*                                                                     
//CHECK002  EXEC PGM=IEFBR14,COND=(1,NE)                               
//*                                                                     
//CHECK003  EXEC PGM=IEFBR14,COND=((3,NE,CONDCOD1),(6,NE,CONDCOD2))     
//*                                                                     
//CHECK0A3  EXEC PGM=IEFBR14,COND=((5,NE,CONDCOD1),(6,EQ,CONDCOD2))     
//*                                                                     
//CHECK004  EXEC PGM=IEFBR14,COND=(3,NE,CONDCOD1)                       
//*                                                                     
//CHECK005  EXEC PGM=IEFBR14,COND=(3,GT,CONDCOD1)                       
//*                                                                     
//CHECK006  EXEC PGM=IEFBR14,COND=(6,GT,CONDCOD2)                       
//*                                                                     
//CHECK007  EXEC PGM=IEFBR14,COND=(11,LT)                               
//*                                                                     
//CHECK008  EXEC PGM=IEFBR14,COND=(7,GT)                               
//*                                                                     
//CHECK009  EXEC PGM=IEFBR14,COND=(7,GT,CONDCOD1)                       
//*                                                                     
//CHECK010  EXEC PGM=IEFBR14,COND=(7,GT,CONDCOD2)                       
//*                                                                     
//CHECK011  EXEC PGM=IEFBR14,COND=(5,GT)                               
//*                                                                     
//CHECK012  EXEC PGM=IEFBR14,COND=(3,GT)                               
//*                                                                     
//CHECK013  EXEC PGM=IEFBR14,COND=(2,GT,CONDCOD1)                       
//*                                                                     

Running that we have the result below:
Code:

CONDCOD1          IDCAMS   RC=0005
CONDCOD2          IDCAMS   RC=0010
CHECK001          IEFBR14  Flushed
CHECK002          IEFBR14  Flushed
CHECK003          IEFBR14  Flushed
CHECK0A3          IEFBR14  RC=0000
CHECK004          IEFBR14  Flushed
CHECK005          IEFBR14  RC=0000
CHECK006          IEFBR14  RC=0000
CHECK007          IEFBR14  RC=0000
CHECK008          IEFBR14  Flushed
CHECK009          IEFBR14  Flushed
CHECK010          IEFBR14  RC=0000
CHECK011          IEFBR14  Flushed
CHECK012          IEFBR14  Flushed
CHECK013          IEFBR14  RC=0000

My question is: why step "CHECK007" runs and "CHECK008" does not?

Thanks in advance!
Back to top
View user's profile Send private message

daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 715
Location: Pennsylvania

PostPosted: Tue Jun 26, 2018 7:54 pm    Post subject:
Reply with quote

Step CHECK008 is flushed because 7 is greater than the rc=000
of step CHECK007 (and several others).

As an aside, I find COND processing very confusing (ass-backwards logic).

The newer IF THEN ELSE construct is much more straight forward.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8363
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 26, 2018 8:23 pm    Post subject:
Reply with quote

CHECK007 executes because the system evaluates 11 against all previous step condition codes and finds that none of them are greater than 11. Hence the step is NOT bypassed and executes.

CHECK008 does not execute because the system evaluates 7 against all previous step condition codes and finds that 7 is greater than at least one of them. Hence the step will be bypassed.

The JCL Reference manual (V2R3) on page 352 says
Quote:
If the return code issued by any of those previous steps causes the test condition to be satisfied, the system evaluates the COND parameter as true and bypasses the job step.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 276
Location: Cincinnati OH USA

PostPosted: Tue Jun 26, 2018 10:38 pm    Post subject:
Reply with quote

NERTS

any are true, skip


Old school tip to results of processing cond=


As Dave suggested, IF THEN ELSE is way to go.
Back to top
View user's profile Send private message
juares castro

New User


Joined: 04 May 2012
Posts: 25
Location: Brazil

PostPosted: Tue Jun 26, 2018 11:43 pm    Post subject: Reply to: JCL COND CODE check
Reply with quote

Thanks everyone!
Robert, paying attention now, it seems very easy with your explanation.
It checks against all RC produced until the step.
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 Converting SAS code to Cobol or Easyt... Ashish.Raghav All Other Mainframe Topics 6 Fri Jun 29, 2018 6:01 pm
No new posts Submit JCL to INTRDR and check the st... srajendran2 COBOL Programming 7 Sat Jun 16, 2018 1:30 am
No new posts What will happen if we dont code STOP... Poha Eater COBOL Programming 4 Mon Jun 04, 2018 5:27 pm
No new posts JCL to set Return code when Time Out ... vinu78 JCL & VSAM 6 Wed May 30, 2018 11:27 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am

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