| Author |
Message |
kovur
New User
Joined: 15 Nov 2007 Posts: 25 Location: India
|
|
|
|
Hi,
I am using Evaluate verb for a condition checking.
| Code: |
Evaluate True
when <flag>
do some processing
when <flag>
do some processing
when other
go to abend routine
End-Evaluate.
|
Here, the problem is, although one of the when conditions is true, the evaluate is still going to When Other. It is happening only with this evaluate. Other evaluates I am using in the program has no problem.
What might be the cause? |
|
| Back to top |
|
 |
References
|
Posted: Tue May 06, 2008 10:28 am Post subject: Re: Evaluate verb for a condition checking |
 |
|
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 903 Location: germany
|
|
|
|
since you know so much, provide your own answer.
If you expect help, provide storage definitions of references used in the evaluate.
what you have provided will garner you nothing. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6033 Location: 221 B Baker St
|
|
|
|
Hello Kovur,
Said differently - it is obvious to us that the code giving you trouble is not the code you posted.
If you don't post the code that is failing, we cannot help. |
|
| Back to top |
|
 |
kovur
New User
Joined: 15 Nov 2007 Posts: 25 Location: India
|
|
|
|
| Code: |
Evaluate True
when wf-rec1
do some processing
when wf-rec2
do some processing
when other
abend the program
End-Evaluate
|
here, wf-rec1 and wf-rec2 are the 88 level variables which are set to true before coming to this evaluate.
Here, when wf-rec1 is true, it is doing the processing below it and then coming to when other instead of coming out of evaluate. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6033 Location: 221 B Baker St
|
|
|
|
Hello,
Post the real code - not what you are posting. This would include the variables definitions.
Also, post one of the "evaluate's" that is working - again the real code.
If the requested info is not posted, i'll lock this topic - to continue this way is just wasting time. |
|
| Back to top |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 252 Location: Spain
|
|
|
|
| sure you cannot figure out what's happening with just 3 or 4 DISPLAYs? |
|
| Back to top |
|
 |
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 100 Location: Bangalore
|
|
|
|
how can anyone tell that the program is performing as stated by kovur by simply looking at the code provided.
the when other part states that the program should go to the abend routine. the program may also go to the abend routine by some other reason.
so, until and unless kovur sends the detailed code, its very difficult to respond. |
|
| Back to top |
|
 |
kovur
New User
Joined: 15 Nov 2007 Posts: 25 Location: India
|
|
|
|
Hi Guys,
I found a strange thing with Evaluate while expediting.
case 1
-----------------
If we write continue in WHEN OTHER, expeditor is going to when other, executing continue and coming out of evaluate.
I will give U an example,
| Code: |
Evaluate true
when wf-mrec1
move a to b
move c to d
when wf-mrec2
move x to y
move s to t
when other
continue
End-Evaluate
.
|
now, although one of the when condition is true, after executing that condition, evaluate is coming to when other, going thru continue and coming out of evaluate.
case 2
---------------------------
In another case, if we write one more statement after continue in when other, it is not going to when other.
| Code: |
Evaluate true
when wf-mrec1
move a to b
move c to d
when wf-mrec2
move x to y
move s to t
when other
continue
add 1 to wa-count
End-Evaluate
.
|
In this case, after executing one of the when conditions, control is coming out of the evaluate.
case 3
------------------------
In one more case if I write a statement before cotinue in when other, control is coming to when other, not executing the statement before continue but directly coming to continue and exiting out of evaluate.
| Code: |
Evaluate true
when wf-mrec1
move a to b
move c to d
when wf-mrec2
move x to y
move s to t
when other
add 1 to wa-count
continue
End-Evaluate
.
|
Here, after executing one of the when conditions, control is coming to when other, not executing the add statement but coming to continue and exiting out of evaluate.
Of course there is no problem in the fuctionality of the code as it is executing only continue in when other, but my question is why it is going to when other and passing thru continue? Once any when condition is true, the evaluate should end. But don't know why it is happening like this. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6033 Location: 221 B Baker St
|
|
|
|
Hello Kovur,
One last chance (because it does look like you are trying). . .
You must post the real code that is in your program
What you are running and what you are posting is not the same and therefore pretty much worthless.
As i mentioned before:
| Quote: |
This would include the variables definitions.
Also, post one of the "evaluate's" that is working - again the real code. |
|
|
| Back to top |
|
 |
kovur
New User
Joined: 15 Nov 2007 Posts: 25 Location: India
|
|
|
|
Dick, But I found this thing with evaluate in other sections also.
Asking some one to try it out and confirm. |
|
| Back to top |
|
 |
ashimer Warnings : 1 Active User
Joined: 13 Feb 2004 Posts: 113
|
|
|
|
Kovur,
how did you judge that it is going to the continue verb ???
as you said if there is a stmt before or after continue it is not executing those stmts and why do u think it is executing continue stmt ??? |
|
| Back to top |
|
 |
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 461 Location: Richmond, Virginia
|
|
|
|
| Ashimer's question is the one to answer. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6033 Location: 221 B Baker St
|
|
|
|
Hello Kovur,
| Quote: |
Dick, But I found this thing with evaluate in other sections also.
Asking some one to try it out and confirm. |
Many of us have evaluate code that does not do as you are seeing in your program. That is the main reason for asking to see the exact code that is doing this.
Something you might try is to clone the problem code into a very small module that is basically only an evaluate and have the code work from ws fields only - no 88's, no fd's, etc. If this simplified close still does this strange behaviour, you could post the entire module and some of us could run it on our machines and post our results.
Good luck and we'll keep on with this 'til we get it  |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 903 Location: germany
|
|
|
|
xpeditor sometimes has misleading behaviour.
as you step thru EVALUATES, nested IF's, it seems as if an instruction is being executed but it is not.
xpeditor seems to always hilight a continue verb, regardless. This is misleading to rookies.
actually, this discussion is just bs. for the op to use xpeditor behaviour as the definition of what is being executed just shows his inexperience.
the op has still not provided his code/jcl and output. i doubt if he will, seems a little thickheaded.
my advice to kovur,
stop trying to find a bug in the compiler or the op-system.
why don't we close this thread.........sure have wasted a lot of time. |
|
| Back to top |
|
 |
Bill O'Boyle
Active User
Joined: 14 Jan 2008 Posts: 138 Location: Orlando, FL, USA
|
|
|
|
| dbzTHEdinosauer wrote: |
xpeditor sometimes has misleading behaviour.
xpeditor seems to always hilight a continue verb, regardless. This is misleading to rookies. |
Dick,
I think the highlighting is a blessing in disguise for us.
What if Compuware decided to display a CONTINUE instead as "A CONDITIONAL NOOP".
Let the games begin!
Regards,
Bill |
|
| Back to top |
|
 |
|
|