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

AND condition using COND parameter


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

New User


Joined: 30 Jan 2006
Posts: 35
Location: Richmond

PostPosted: Wed Oct 08, 2008 1:08 am
Reply with quote

Hi,

Can any one tell me how to get an AND condition using COND parameter in JCL?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Oct 08, 2008 1:26 am
Reply with quote

You can't. That's why there's the far superior IF/THEN/ELSE construct.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Oct 08, 2008 4:09 am
Reply with quote

Hi,

I'm not sure if this is what you meant but you can code this
Code:
//         COND=((4,LT,ST01),(4,LT,ST02),(4,LT,ST03)) 




Gerry
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 08, 2008 5:43 am
Reply with quote

Hi Gerry,

If any of those are true, the step won't run (they are ORed). . .

FWIW, in several thousand jobstreams on a few hundred systems, i've not yet seen the need for an AND in conditon codes. I suspect this is because the people who wrote the jobstreams and the code wrote so the jobs worked with COND as delivered.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Oct 08, 2008 6:40 am
Reply with quote

Hi Dick,

I used the following
Code:
//         COND=((1,NE,ST01),(2,NE,ST02),(3,LT,ST03))


and ST04 only runs when ST01 returns a 1 and ST02 returns a 2 and ST03 returns a 3.

If a step does not return the mentioned codes, ST04 flushes.

The results are identical to using
Code:
//CHECK08  IF (ST01.RC = 1)         
//         &  (ST02.RC = 2)         
//         &  (ST03.RC = 3) THEN   


One place where I have seen this is in the old Compile link and go PROC

Code:
//GO       EXEC  PGM=*.LKED.SYSLMOD,COND=((5,LT,COB),(5,LT,LKED)) 



Gerry
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 08, 2008 7:50 am
Reply with quote

Hi Gerry,

Interesting icon_exclaim.gif

I believe there's a typo in your 3rd condition
Code:
COND=((1,NE,ST01),(2,NE,ST02),(3,LT,ST03))

It allows an rc=2 to run also. . .

Let me know if i've not made a mistake and i'll edit if you'd like.

d
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Oct 08, 2008 8:44 am
Reply with quote

Hi Dick,

you are right, it should have been
Code:
//         COND=((1,NE,ST01),(2,NE,ST02),(3,NE,ST03))


but results are still the same.

This is the JCL I used to test it with various combinations in ST01 ST02 & ST03,
Code:
//*-------------------------------------------------------------       
//*                                                                     
//ST01     EXEC PGM=IDCAMS                                             
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SET MAXCC=3
/*                                                         
//*-------------------------------------------------------------       
//*                                                                     
//ST02     EXEC PGM=IDCAMS                                             
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SET MAXCC=3                                                           
/*                                                                     
//*-------------------------------------------------------------   
//*   
//ST03     EXEC PGM=IDCAMS                                             
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SET MAXCC=3                                                           
/*                                                                     
//*-------------------------------------------------------------     
//*                                                                   
//ST04     EXEC PGM=IDCAMS,                                           
//         COND=((1,NE,ST01),(2,NE,ST02),(3,NE,ST03))                 
//SYSPRINT DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  SET MAXCC=0                                                         
/*                                                                   
//*-------------------------------------------------------------     


I hope I haven't missed something.


Gerry
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 08, 2008 8:48 am
Reply with quote

Hi Gerry,

Quote:
I hope I haven't missed something.
You haven't icon_smile.gif

My guess is that more than just me weren't thinking of that as an AND icon_redface.gif and yup, i too remember the old compile/link - just took it for granted for so long.

Good catch icon_cool.gif

d
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