Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us