Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Evaluate within Evaluate - multiple

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
radhakrishnan82

Active User


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

PostPosted: Fri Jun 25, 2010 1:28 pm    Post subject: Evaluate within Evaluate - multiple
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: 6968
Location: porcelain throne

PostPosted: Fri Jun 25, 2010 2:05 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Jun 25, 2010 2:43 pm    Post subject:
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    Post subject:
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: 436
Location: chennai, India

PostPosted: Fri Jun 25, 2010 3:44 pm    Post subject:
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: 436
Location: chennai, India

PostPosted: Fri Jun 25, 2010 3:44 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Fri Jun 25, 2010 4:10 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us