View previous topic :: View next topic
|
Author |
Message |
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
What does the manual (link at the top of the page) tell you? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
answer to your question: yes
how?
untested
nor
verified
Code: |
//STEP06 EXEC PGM=??
// COND=(4,NE,STEP02),(4,NE,STEP04))
|
|
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
NERTS -- aNy(E) aRe True Skip this step
old programmers memory aid |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
I like a good old fashioned NY style discussion! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|