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

Can we use multiple ANDs with WHEN


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

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Wed Nov 24, 2010 9:54 am
Reply with quote

Plz refer the below piece of code:

EVALUATE TRUE
WHEN A AND B
ADD 100 to WS1
WHEN D AND E
ADD 200 to WS2
END-EVALUATE

is AND legal??

Can we use multiple ANDs with WHEN?

I tested this and it is working fine. I am surprised to see it is working fine. Is this kind of AND usage documented somewhere ???
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 24, 2010 11:00 am
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals". Look in the COBOL Language Reference for your release of COBOL.

Here is a link to the EVALUATE description:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr50/6.2.13

There is also additoinal info in the Programming Guide:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3pg50/1.5.1.1.2
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Nov 25, 2010 3:11 pm
Reply with quote

Morning Sir !

You could use ALSO instead of and with WHEN.
As Dick told, read about Evaluate in the manual.
Back to top
View user's profile Send private message
lonerusher

New User


Joined: 30 Nov 2010
Posts: 4
Location: India

PostPosted: Wed Dec 01, 2010 2:10 pm
Reply with quote

You can also use Multiple AND with IF condition clause.
I havn't tried multiple AND with WHEN... Its better to use EVALUATE clause to handle MULTIPLE AND..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 01, 2010 9:09 pm
Reply with quote

Hello,

Please do not add things to topics that provide no new information. . .

And when new information is added, it should be tested/verified not something that has not been tried. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Dec 01, 2010 9:19 pm
Reply with quote

lonerusher has made 7 such posts. have no idea how many more until he is satisfied with his post count.
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