View previous topic :: View next topic
|
Author |
Message |
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Hi,
Is it possible to have multiple evaluates with EVALUATE verb in COBOL.
eg.,
Code: |
Evaluate VarA
when '00'
Evaluate VarB
when '21'
perform stmts
when other
continue
end-evaluate
when '01'
continue
when others
Abend
End-evaluate |
I tried in my cobol version.
Code: |
IGYPS2072-S "WHEN" was invalid. Skipped to the next verb, period or p
Same message on line: 215 228 235 255 297
420 431 434 439 444
586 592 632 |
I agree we can surely have alternatives for this.
Would like to confirm Nested evaluate is acceptable in COBOL. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you can.
you are being disingenuous with the error message display.
there is no way we can relate the error lines and what you have provided as code.
what is your cobol version? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
An evaluate is just IF statements. Syntax makes it much easier to read and understand what would otherwise be nested/complex if statements - so if you can have nested-IFs(and I pre-assume you agree) then you can have nested-EVALUATEs too.
Suggest you show us the "actual-code" instead of your interpretation of the code. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Since I am in a mood to make guesses ... I will make one for this also ...
Radhakrishnan,
Am guessing in your program, you might have put a period somewhere in between the nested EVALUATE.
IF this is case am pretty sure you might have got a message like this during compilation ...
Code: |
IGYPS2113-E The explicit scope terminator "END-EVALUATE" was found without a matching verb. The scope terminator was discarded. |
|
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
VS cobol II. Thanks, Dick.
One of the line has null/period and Evaluate seems to be ignored. I corrected the error and its fine now. |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
yes. it was. Thanks Binop. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
radhakrishnan v,
thx for getting back to us and providing the resolution to your problem. |
|
Back to top |
|
|
|