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
 

 

Can we use multiple ANDs with WHEN

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

New User


Joined: 15 May 2006
Posts: 90

PostPosted: Wed Nov 24, 2010 9:54 am    Post subject: Can we use multiple ANDs with WHEN
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

Site Director


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

PostPosted: Wed Nov 24, 2010 11:00 am    Post subject:
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:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr50/6.2.13

There is also additoinal info in the Programming Guide:
http://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: 755
Location: Germany

PostPosted: Thu Nov 25, 2010 3:11 pm    Post subject:
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    Post subject: As far as I know Mainframes...
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

Site Director


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

PostPosted: Wed Dec 01, 2010 9:09 pm    Post subject:
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    Post subject:
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    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 To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


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