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

Check the condition of two different steps


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

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Mon May 31, 2010 7:27 pm
Reply with quote

Is it possible to ceck the condition of two different steps using COND CODE option

Example, i need to execute step 6 only if step 2 and step 4 have a
RC of "04", if eitheir one returns 0 then the step should not execute.


i know it can acieved using IF - ENDIF optin , i want to know if its achivable through COND CODE option.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon May 31, 2010 7:46 pm
Reply with quote

What does the manual (link at the top of the page) tell you?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 31, 2010 7:54 pm
Reply with quote

answer to your question: yes


how?
untested
nor
verified


Code:

//STEP06   EXEC PGM=??
//              COND=(4,NE,STEP02),(4,NE,STEP04))
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Jun 01, 2010 1:07 am
Reply with quote

dbzTHEdinosauer thanks for the reply , but i belive the code above

works like an OR condition , what i need is an AND condition. ie the step should execute only if both the prior steps gave a RC 04.


Robert Sample , yes i went through the manual , i saw only the code mentioned here , i couldnt find a reference where a logical AND could be implemented

Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 01, 2010 1:24 am
Reply with quote

You probably couldn't find any references to AND conditions in the manuals because condition code testing doesn't support AND conditions, only OR conditions. In other words, as the manual says, you can check conditions for multiple steps but only for an OR condition. Your original problem statement did NOT mention whether you wanted AND or OR logic.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jun 01, 2010 4:33 am
Reply with quote

Hi,

I see nothing wrong with Dick's answer,

my tests reveal when

STEP2 returns a 0 and STEP4 returns a 0, STEP6 will flush

STEP2 returns a 0 and STEP4 returns a 4, STEP6 will flush

STEP2 returns a 4 and STEP4 returns a 0, STEP6 will flush

STEP2 returns a 4 and STEP4 returns a 4, STEP6 will run.


Gerry
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: Tue Jun 01, 2010 5:09 am
Reply with quote

NERTS -- aNy(E) aRe True Skip this step

old programmers memory aid
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 01, 2010 5:21 am
Reply with quote

cvishu,
you make a habit of asking questions about basic concepts
and then when you receive a solution,
you make a stupid remark - which shows that you have made no attempt to understand COND on an EXEC statement.

DAVE, thx for the reminder of NERTS - that is the way I learned.

cvishu,
if you forget about all your silly logic and just remember
if anything is true, skip the step.
That is why i used the NE 4,
which obviously was not noticed.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Jun 01, 2010 11:44 am
Reply with quote

Robert , i had clearly put in my query tat i want to check an and condition
cvishu wrote:

execute step 6 only if step 2 and step 4 have a
RC of "04", if eitheir one returns 0 then the step should not execute.



dbzTHEdinosauer , i appreciate your efforts in helping out noobs , but a politer way of responding would be great , You may have 10-15 years of experience in mainframes and me just 2+ years , trust me when i have spent the same amount of years as u had i will definitely stop my STUPID remarks and questions.

i don't want to engage in an argument here, but stop being rude , and i sincerely thank the time and effort people put here in responding to queries .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 01, 2010 4:23 pm
Reply with quote

cvishu,

and it is not the questions, it is the response to the solutions.
it is one thing to ask a question about basics,
it is another to say that the provided solution is incorrect
when you obviously don't know jack.

you showed no respect for my effort to provide a solution.
why should I show you any respect.

learn your skills,
and you know where you can stuff this
DON'T BE RUDE
BS.
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: Wed Jun 02, 2010 4:54 am
Reply with quote

I like a good old fashioned NY style discussion!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jun 02, 2010 5:05 am
Reply with quote

Quote:
I like a good old fashioned NY style discussion!


I don't. That was one of the reasons I left New York (Brooklyn/Bronx) for California.

cvis,

I would suggest you try out posted solutions rather than assuming they won't work. That way, if they do work, you'll know it and if they don't work, you'll be on solid ground when you say so.
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 SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts How to check whether who renamed the ... JCL & VSAM 3
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
Search our Forums:

Back to Top