Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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 -> Mainframe COBOL
Author Message
mikayag

New User


Joined: 10 Mar 2005
Posts: 9

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
References
PostPosted: Fri Mar 11, 2005 12:08 am    Post subject: Re: What Does ALSO mean in an EVALUATE statement Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1