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
 

 

How a COND parameter works if we code Multiple Conditions ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How a COND parameter works if we code Multiple Conditions ?
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

Site Director


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

PostPosted: Wed Aug 15, 2007 11:37 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Aug 15, 2007 11:39 pm    Post subject: Reply to: How a COND parameter works if we code Multiple Con
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    Post subject: Reply to: How a COND parameter works if we code Multiple Con
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: 8593
Location: Back in jolly old England

PostPosted: Sun Aug 19, 2007 1:52 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sun Aug 19, 2007 2:11 am    Post subject: Re: Reply to: How a COND parameter works if we code Multiple
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

Site Director


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

PostPosted: Sun Aug 19, 2007 8:49 am    Post subject:
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: 247
Location: Cincinnati OH USA

PostPosted: Sun Aug 19, 2007 7:45 pm    Post subject:
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    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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts JTS parameter Shashank Chaubey JCL & VSAM 2 Thu Jul 13, 2017 4:15 pm
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm


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