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

What Does ALSO mean in an EVALUATE statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
Search our Forums:

Back to Top