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
 

 

Explain EVALUATE with Examples

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sekarvnm
Currently Banned

New User


Joined: 06 Oct 2006
Posts: 4
Location: NAGERCOIL

PostPosted: Fri Oct 06, 2006 12:13 pm    Post subject: Explain EVALUATE with Examples
Reply with quote

CAN ANY BODY EXPLAIN EVALUATE WITH EXAMPLE.WHICH SITUATION WE CAN USE
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 12:27 pm    Post subject:
Reply with quote

Hi SEKAR,

The EVALUATE command provides a shorthand notation for a series of nested IF statements.
Another example

Evaluate sqlcode
when +0
Continue
when +100
Display ' row not found'
When other
Raise an error
End-Evaluate.

In these code if sqlcode is eq to 0 it will execute next sentennce if +100 then it will display row is not found & if it is other than 0 & 100 it will raise the error

The equivalent IF command:

IF (sqlcode>= 0)
continue
ELSE
IF (sqlcode = 100)
Display 'row not found'
Else
raise an error
END-IF
END-IF.
Few notes.
Only one WHEN branch is chosen per execution of the EVALUATE, and the checking of the WHEN branches is done from top to bottom.

If none of the WHEN branches can be chosen, and a WHEN OTHER phrase exists, the WHEN OTHER branch is executed.

If none of the WHEN branches can be chosen, and there is no WHEN OTHER phrase, the EVALUATE simply terminates.
Hope it will helpful
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can someone explain me this JCL line ... PeterHolland JCL & VSAM 9 Sat Dec 12, 2015 7:22 am
No new posts DB2 Explain agkshirsagar DB2 3 Wed Aug 28, 2013 6:23 pm
No new posts can some one explain the below code... ram_vizag JCL & VSAM 3 Thu Aug 22, 2013 4:35 pm
No new posts Please explain this SQL CODE. tamminenisidhartha DB2 4 Wed Mar 13, 2013 5:05 pm
No new posts Sticky: ISPF examples enrico-sorichetti TSO/ISPF 2 Mon Aug 27, 2012 6:59 pm


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