MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Difference b/w EVALUATE AND & also

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ravii_cbe
Beginner


Joined: 28 Mar 2003
Posts: 6
Topics: 5
Location: Chennai

PostPosted: Wed Apr 30, 2003 6:20 am    Post subject: Difference b/w EVALUATE AND & also Reply with quote



What is the difference b/w EVALUATE (A AND B) Vs EVALUATE (A Also B).

When I tried EVALUATE (A also B) also C . I didn't get compile time error. when I use AND instead of AND i got compiling error. Is it the difference b/w these two?


From
Ravi
_________________
Thanks & Regards
M. RaviShankar
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Wed Apr 30, 2003 6:37 am    Post subject: Reply with quote

Its just syntax. 'Also' is allowed and 'And' is not.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Apr 30, 2003 11:59 am    Post subject: Reply with quote

Ravi,

ALSO in an EVALAUATE statement separates selection subjects within a set of selection subjects and also separates selection objects within a set of selection objects.

Check this link for a better understanding of EVALUATE statement.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGYLR205/6.2.13?DT=20000927030801

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri May 02, 2003 1:24 pm    Post subject: Reply with quote

Some don't cotton to the ALSO approach. They see it as obscure and misleading. Confused If you feel the same way you can try the following, it gives the "effect" of an AND:

EVALUATE TRUE
WHEN WS-A = x AND WS-B = y
blah, blah, blah1
WHEN WS-A = x OR WS-B = y
blah, blah, blah2
END-EVALUATE

In fact, any valid conditional expression, simple or complex, can be used.

Jack
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu May 15, 2003 12:37 am    Post subject: Reply with quote

Though it might be slower but I myself prefer 'EVALUATE TRUE' because it is very easy to add a new condition while modification. Say, in slade's example, I can easily add "WHEN WS-C = 'Z'".

Since we don't have Else-If in Cobol so I even prefer using Evaluate instead of If because there is always a chance that your analysis was wrong and you need to next few more Ifs in the earlier If. And then it becomes very unreadable.

Dibakar.
Back to top
View user's profile Send private message Send e-mail
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun May 18, 2003 12:40 am    Post subject: Reply with quote

I like to alternate IFs and EVALs. I seems to "read" better. Fer instance:

IF FLD-A = 1
IF FLD-B = 46
do this....

IF FLD-A = 1
EVALUATE FLD-B
WHEN 46
do this....

I don't know, it just seems to flow better. This is the way I'd present the idea to the reader if we were talking face to face.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group