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: 92

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: 6967
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm


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