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

How a COND parameter works if we code Multiple Conditions ?


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

New User


Joined: 01 Aug 2007
Posts: 10
Location: Pune

PostPosted: Wed Aug 15, 2007 10:31 pm
Reply with quote

Hi,

I have small Doubt on Multiple Conditions ( COND Parameter).
Take for example, I have below JCL with multiple conditions

//STEP1 EXEC PGM=PGMONE
//STEP2 EXEC PGM=PGMTWO
//STEP3 EXEC PGM=PGM3,COND=((4,EQ),(8,LE),(16,EQ))

Well, coming to the question..
Q1 : Among all 3 conditions in COND parameter ,Is it will always check for FALSE to get execute STEP3 even though the first and second conditions are TRUE ? ( as it will apply "OR" it will look for TRUE or FALSE)

Q2: If First condition ( 4, EQ ) is TRUE , Then What action will it take ? Is it will quit from the condition that we got TRUE status Or is it will check the second condition (8,LE) and further conditions (16, EQ) also ?

As per my knowledge , It will always check for the FALSE status to get execute the STEP3. Until it finds FALSE it will check all the multiple conditions.... Is my assumption is correct ? Please correct me if my assumption is wrong !! Thank You.
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 Aug 15, 2007 11:37 pm
Reply with quote

Hello,

I'd suggest you think of this differently
Quote:
It will always check for the FALSE status to get execute the STEP3.


When a COND= test is true, the step will not execute.
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 Aug 15, 2007 11:39 pm
Reply with quote

According to the Z/OS V1R7.0 MVS JCL Reference manual:

Quote:

If any of the test conditions are satisfied, the system evaluates the COND parameter as true and bypasses the job step. If none of the test conditions specified on the COND parameter are satisfied, the system evaluates the COND parameter as false and executes the job step.
Back to top
View user's profile Send private message
BalaMuraliL

New User


Joined: 01 Aug 2007
Posts: 10
Location: Pune

PostPosted: Sat Aug 18, 2007 10:55 pm
Reply with quote

Hi Superk,

This is continuation for your last reply . First of all thanks a lot for your inputs. Let me put my doubt bit clearly based on your inputs...

As per your last reply Explanation

1.
If any of the test conditions are satisfied : As per this statment, First of all , It is checking all the condition that what ever we coded in One COND statement Right ?

2.
the system evaluates the COND parameter as true and bypasses the job step : This is general point in COND . I will agree with this stmt.

3.
If none of the test conditions specified on the COND parameter are satisfied : It means it is checking all the conditions right ?

As per the 1 & 3 statements , if we code multiple conditions , the system is checking all the conditions that what ever we coded on COND . When the system is checking the multiple conditions, system may find TRUE Or FALSE / All TRUE ( in this case it will bypass ) / All FALSE ( in this case it will execute) . But, If it finds TRUE & FALSE .... In this case which one will it take ? Either TRUE / FALSE ?

Hope it is clear my doubt.. Please let me know if have are not cleare with question. Thank You.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun Aug 19, 2007 1:52 am
Reply with quote

Please take the time to read the answer given by Superk, think about it, and your answer will be given.

Take special notice of the word ANY
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun Aug 19, 2007 2:11 am
Reply with quote

BalaMuraliL wrote:
But, If it finds TRUE & FALSE .... In this case which one will it take ? Either TRUE / FALSE ?
Do you understand the difference between the Boolean concept of TRUE and FALSE?
There is a difference betwen AND and OR, do you understand it?
Do you understand the defaults?
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: Sun Aug 19, 2007 8:49 am
Reply with quote

Hello,

The answer you need was the first reply.
Quote:
When a COND= test is true, the step will not execute.
followed by the post from SuperK which is a direct quote from the manual.

While it may be slightly confusing (because to many it seems backwards), the step will be bypassed when a COND= is true.

If you "overthink" it, it will completely jumble.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Sun Aug 19, 2007 7:45 pm
Reply with quote

old school way of remembering COND results was

N E R T S as in ANY ARE TRUE, SKIP this step
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to load to DB2 with column level ... DB2 6
Search our Forums:

Back to Top