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

Evaluate within Evaluate - multiple


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Fri Jun 25, 2010 1:28 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jun 25, 2010 2:05 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 25, 2010 2:43 pm
Reply with quote

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
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Jun 25, 2010 2:55 pm
Reply with quote

Since I am in a mood to make guesses ... I will make one for this also ... icon_razz.gif

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
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Fri Jun 25, 2010 3:44 pm
Reply with quote

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
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Fri Jun 25, 2010 3:44 pm
Reply with quote

yes. it was. Thanks Binop.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jun 25, 2010 4:10 pm
Reply with quote

radhakrishnan v,

thx for getting back to us and providing the resolution to your problem.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top