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
 
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: 1243
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 question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm

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