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
 

 

what is the disadvantage of evaluate verb

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

New User


Joined: 28 Mar 2007
Posts: 4
Location: Cochin

PostPosted: Mon Jun 11, 2007 2:42 pm    Post subject: what is the disadvantage of evaluate verb
Reply with quote

hi ,

plz tell what is the advantage and disadvantage of evaluate verb
Back to top
View user's profile Send private message

munikumar
Currently Banned

New User


Joined: 18 Apr 2007
Posts: 24
Location: India

PostPosted: Mon Jun 11, 2007 2:46 pm    Post subject:
Reply with quote

EVALUATE is the case statement in COBOL.

You can validate a condition with multiple checkings. It will give you a cleare picture and more understandability. There are number of EVALUATE syntaxes that we can use.

For example,

EVALUATE TRUE
WHEN <condition1>
statement-1s
WHEN <condition2>
statement-2s
.
.
WHEN OTHER
statement-os
END-EVALUATE.
Back to top
View user's profile Send private message
anujageorge

New User


Joined: 28 Mar 2007
Posts: 4
Location: Cochin

PostPosted: Mon Jun 11, 2007 2:49 pm    Post subject: Re: what is the disadvantage of evaluate verb
Reply with quote

what is its disadvantage
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 2:52 pm    Post subject:
Reply with quote

What makes you think there is a disadvantage?
Back to top
View user's profile Send private message
gauravgupta2808
Warnings : 1

New User


Joined: 31 May 2007
Posts: 31
Location: Chennai, India

PostPosted: Mon Jun 11, 2007 2:56 pm    Post subject:
Reply with quote

Disadvantages against what ...
If i consider IF-ELSE & EVALUATE, then IF-ELSE affects readability if there are many comparisons.. There EVALUATE is better option.
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Tue Jun 12, 2007 12:26 am    Post subject: Re: what is the disadvantage of evaluate verb
Reply with quote

EVALUATE clause is good, very good.

Stacks of IF ELSE END-IF, IF ELSE END-IF, ad naseum are not good (if you are lucky enough to actually find END-IF used....).

Make us happy, use EVALUATE! icon_biggrin.gif

Seriously, there are no disadvantages to using EVALUATE, unless your aim is to write code that is hard for maintenance programmers to understand. Personally, I'd rather wade through two screens of Evaluates than a page of IF/ELSE/END-IF.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 964
Location: Richmond, Virginia

PostPosted: Tue Jun 12, 2007 1:31 am    Post subject:
Reply with quote

Good programming practice also calls for your last WHEN being WHEN OTHER, with either legitimate "other" processing code, or an error indicator if every possible case has been defined by the previous WHEN's, even if you know they have been.

No one will complain, quite the contrary, by the "extra" code. If nothing else, a future modification may screw up your perfect program.
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 Logic of START verb with Read next sandeep kumar302 COBOL Programming 6 Tue Feb 04, 2014 12:21 pm
No new posts Evaluate statement, when-clause in co... UmeySan COBOL Programming 10 Mon Jul 16, 2012 6:49 pm
No new posts Generate report with out using IF/EVA... bbharathiraj COBOL Programming 25 Tue May 22, 2012 10:19 am
No new posts Calling sub program using CALL verb Ron Masters COBOL Programming 16 Fri Apr 06, 2012 4:37 pm
This topic is locked: you cannot edit posts or make replies. Want to put in a loop in EVALUATE maxsubrat COBOL Programming 24 Fri Apr 06, 2012 3:35 pm


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