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
 

 

AND condition using COND parameter

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: AND condition using COND parameter
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

Moderator Team Head


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

PostPosted: Wed Oct 08, 2008 1:26 am    Post subject: Reply to: AND condition using COND parameter
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: 1703
Location: Australia

PostPosted: Wed Oct 08, 2008 4:09 am    Post subject:
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

Site Director


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

PostPosted: Wed Oct 08, 2008 5:43 am    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Oct 08, 2008 6:40 am    Post subject:
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

Site Director


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

PostPosted: Wed Oct 08, 2008 7:50 am    Post subject: Reply to: AND condition using COND parameter
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: 1703
Location: Australia

PostPosted: Wed Oct 08, 2008 8:44 am    Post subject:
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

Site Director


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

PostPosted: Wed Oct 08, 2008 8:48 am    Post subject: Reply to: AND condition using COND parameter
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    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 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
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm


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