View previous topic :: View next topic
Author
Message
akhi007 New User Joined: 30 Jan 2006Posts: 35 Location: Richmond
Hi,
Can any one tell me how to get an AND condition using COND parameter in JCL?
Back to top
superk Global Moderator Joined: 26 Apr 2004Posts: 4652 Location: Raleigh, NC, USA
You can't. That's why there's the far superior IF/THEN/ELSE construct.
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
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
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hi Gerry,
Interesting
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
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hi Gerry,
Quote:
I hope I haven't missed something.
You haven't
My guess is that more than just me weren't thinking of that as an AND and yup, i too remember the old compile/link - just took it for granted for so long.
Good catch
d
Back to top
Please enable JavaScript!