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: 4649
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 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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm


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