View previous topic :: View next topic
|
Author |
Message |
kovur
New User
Joined: 15 Nov 2007 Posts: 36 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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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: 36 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
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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: 344 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: 165 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: 36 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
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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: 36 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
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
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: 1042 Location: Richmond, Virginia
|
|
|
|
Ashimer's question is the one to answer. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, 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 |
|
|
Prakash RS
New User
Joined: 17 Mar 2008 Posts: 2 Location: Bangalore
|
|
|
|
IF TEMP-FILE-ID NOT EQUAL CURR-FILE-ID AND CURR-FILE-TYPE = '01'
MOVE SPACES TO XXXX FIELD
MOVE 'YYYY-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
END-IF.
IF TEMP-FILE-ID NOT EQUAL CURR-FILE-ID AND CURR-FILE-TYPE = '02'
MOVE SPACES TO XXXX FIELD
MOVE 'ZZZZ-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
END-IF.
IF TEMP-FILE-ID NOT EQUAL CURR-FILE-ID AND CURR-FILE-TYPE = '03'
MOVE SPACES TO XXXX FIELD
MOVE 'WWW-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
END-IF.
Can I code above IF statement like this (Syntax),
EVALUATE TEMP-FILE-ID NOT EQUAL CURR-FILE-ID AND CURR-FILE-TP
WHEN TRUE AND '01'
MOVE SPACES TO XXXX FIELD
MOVE 'YYYY-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
WHEN TRUE AND '02'
MOVE SPACES TO XXXX FIELD
MOVE 'ZZZZZ-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
WHEN TRUE AND '03'
MOVE SPACES TO XXXX FIELD
MOVE 'WWW-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
WHEN OTHER
CONTINUE.
END-EVALUATE.
Thanks,
Prakash |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Hi Prakash,
Use this construct
Code: |
EVALUATE TRUE ALSO CURR-FILE-TP
WHEN TEMP-FILE-ID NOT EQUAL CURR-FILE-ID ALSO '01'
MOVE SPACES TO XXXX FIELD
MOVE 'YYYY-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
WHEN TEMP-FILE-ID NOT EQUAL CURR-FILE-ID ALSO '02'
MOVE SPACES TO XXXX FIELD
MOVE 'ZZZZZ-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
WHEN TEMP-FILE-ID NOT EQUAL CURR-FILE-ID ALSO '03'
MOVE SPACES TO XXXX FIELD
MOVE 'WWW-NAME' TO XXXX FIELD
PERFORM 10-INSERT-PARA
WHEN OTHER
CONTINUE
END-EVALUATE.
|
|
|
Back to top |
|
|
Prakash RS
New User
Joined: 17 Mar 2008 Posts: 2 Location: Bangalore
|
|
|
|
Hi Ashimer,
Thanks for the reply. |
|
Back to top |
|
|
|