Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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: 6970
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us