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
 

 

Question regarding EVALUATE

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

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Wed May 31, 2006 1:49 pm    Post subject: Question regarding EVALUATE
Reply with quote

05 WS-SQL-RETCODE PIC S9(04) COMP VALUE +0.
88 C-DB2-OK VALUE +0.
88 C-REC-NOT-FOUND VALUE +100.
88 C-DUPLICATE VALUE -811.

MOVE SQLCODE TO WS-SQL-RETCODE
EVALUATE TRUE
WHEN C-DB2-OK
WHEN C-REC-NOT-FOUND
CONTINUE

WHEN OTHER
SET MESSAGE-REC-NOT-FOUND TO TRUE
PERFORM A080-MOVE-TO-SBAM511-O
END-EVALUATE

Could anybody tell me if the red-highlighted codes are right which means when C-DB2-OK or C-REC-NOT-FOUND ?
Back to top
View user's profile Send private message

sada_polaris

New User


Joined: 24 May 2006
Posts: 13

PostPosted: Wed May 31, 2006 3:16 pm    Post subject: Re: EVALUATE
Reply with quote

Quote:
05 WS-SQL-RETCODE PIC S9(04) COMP VALUE +0.
88 C-DB2-OK VALUE +0.
88 C-REC-NOT-FOUND VALUE +100.
88 C-DUPLICATE VALUE -811.

MOVE SQLCODE TO WS-SQL-RETCODE
EVALUATE TRUE
WHEN C-DB2-OK
WHEN C-REC-NOT-FOUND
CONTINUE
WHEN OTHER
SET MESSAGE-REC-NOT-FOUND TO TRUE
PERFORM A080-MOVE-TO-SBAM511-O
END-EVALUATE


Use as follows

Code:

MOVE SQLCODE TO WS-SQL-RETCODE
EVALUATE TRUE
WHEN C-DB2-OK  OR C-REC-NOT-FOUND
CONTINUE
WHEN OTHER
SET MESSAGE-REC-NOT-FOUND TO TRUE
PERFORM A080-MOVE-TO-SBAM511-O
END-EVALUATE

Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Wed May 31, 2006 5:56 pm    Post subject:
Reply with quote

That's right, this format is equivalent to an 'OR'.
For example, I use this in my CICS programs:

Code:
EVALUATE EIBAID
    WHEN DFHCLEAR
    WHEN DFHPF3
    WHEN DFHPF15
        PERFORM PROGRAM-FINISH
    WHEN DFHPF8
    WHEN DFHPF20
        PERFORM PAGE-DOWN
    WHEN ...

END-EVALUATE


The IBM documentation says:
"If a WHEN phrase is selected, execution continues with the first imperative-statement-1 following the selected WHEN phrase. Note that multiple WHEN statements are allowed for a single imperative-statement-1."
Back to top
View user's profile Send private message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Thu Jun 01, 2006 7:09 am    Post subject:
Reply with quote

THANK YOU ALL! icon_smile.gif
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 Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts SQL Order By related question Joseph K Thomas DB2 8 Fri Mar 18, 2016 12:53 pm
No new posts DFSort Question krrp DFSORT/ICETOOL 9 Mon Mar 07, 2016 7:11 pm
No new posts Question: REORG on LOB tablespaces rakesh1155 DB2 1 Fri Aug 14, 2015 2:14 pm


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