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 Does ALSO mean in an EVALUATE statement

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

New User


Joined: 10 Mar 2005
Posts: 16

PostPosted: Fri Mar 11, 2005 12:08 am    Post subject: What Does ALSO mean in an EVALUATE statement
Reply with quote

Hi there,

I'm a newbie in COBOL and mainframe. I see codes in existing modules such as this:

EVALUATE SL-RET-CODE ALSO SQLERRD(3)
WHEN DB-SUCCESS ALSO NOT ZERO
PERFORM <SOME CODES>
WHEN DB-FAIL ALSO ZERO
PERFORM <SOME CODES>
.
.
.


What will happen if I omit the ALSO in the EVALUATE statement and there is an ALSO in the WHEN
Back to top
View user's profile Send private message

serious_mainframes

New User


Joined: 10 Mar 2005
Posts: 2

PostPosted: Fri Mar 11, 2005 12:57 am    Post subject: Re
Reply with quote

hi,


also is used for specifying a additional condition to an evaluate statement
so that the will be applied to whole block
Back to top
View user's profile Send private message
kingofmf

New User


Joined: 02 Mar 2005
Posts: 13
Location: Bangalore

PostPosted: Sun Mar 13, 2005 1:47 pm    Post subject:
Reply with quote

take the following example-
EVALUATE VAR1
WHEN 1 PERFORM PARA-1
WHEN 2 PERFORM PARA-2
WHEN 3 PERFORM PARA-3
END-EVALUATE.
depending on the value of VAR1 it execute para-1 to para-3.
here WHEN 1 PERFORM PARA-1 is equivallent to the statement
IF VAR1 = 1
PERFORM PARA-1
END-IF.

now see the following
EVALUATE VAR1 ALSO VAR2
WHEN 1 ALSO 2 PERFORM PARA-1
WHEN 1 ALSO 3 PERFORM PARA-2
.
.
END-EVALUATE.
here to perfrom para -1 var1 and var2 must contain value 1 and 2.
ie the statement is equivallent to
IF VAR1 = 1 AND VAR2 = 2
PERFORM PARA-1
END-IF.

i think the above discussion will clear your concept
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am
No new posts Inspect statement spoorni COBOL Programming 5 Mon Jun 06, 2016 9:53 pm


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