Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.13 EVALUATE Statement



The EVALUATE statement provides a shorthand notation for a series of nested IF statements. It can evaluate multiple conditions. That is, the IF statements can be made up of compound conditions. The subsequent action of the object program depends on the results of these evaluations.


    ___ Format _______________________________________________________________________________________ 
   |                                                                                                  |
   | >>__EVALUATE__ _identifier-1_ __ _____________________________ ________________________________> |
   |               |_literal-1____|  | <_________________________  |                                  |
   |               |_expression-1_|  |___ ALSO__ _identifier-2_ _|_|                                  |
   |               |_TRUE_________|             |_literal-2____|                                      |
   |               |_FALSE________|             |_expression-2_|                                      |
   |                                            |_TRUE_________|                                      |
   |                                            |_FALSE________|                                      |
   |                                                                                                  |
   |    <____________________________________________________________________________                 |
   |      <________________________________________________                          |                |
   | >______WHEN__| phrase 1 |__ ________________________ _|__imperative-statement-1_|______________> |
   |                            | <____________________  |                                            |
   |                            |___ALSO__| phrase 2 |_|_|                                            |
   |                                                                                                  |
   | >__ ____________________________________ __ ______________ ___________________________________>< |
   |    |_WHEN OTHER__imperative-statement-2_|  |_END-EVALUATE_|                                      |
   |                                                                                                  |
   | phrase 1:                                                                                        |
   | |__ _ANY________________________________________________________________________________ ______| |
   |    |_condition-1________________________________________________________________________|        |
   |    |_TRUE_______________________________________________________________________________|        |
   |    |_FALSE______________________________________________________________________________|        |
   |    |_ _____ __ _identifier-3____________ __ __________________________________________ _|        |
   |      |_NOT_|  |_literal-3_______________|  |_ _THROUGH_ __ _identifier-4____________ _|          |
   |               |_arithmetic-expression-1_|    |_THRU____|  |_literal-4_______________|            |
   |                                                           |_arithmetic-expression-2_|            |
   |                                                                                                  |
   | phrase 2:                                                                                        |
   | |__ _ANY________________________________________________________________________________ ______| |
   |    |_condition-2________________________________________________________________________|        |
   |    |_TRUE_______________________________________________________________________________|        |
   |    |_FALSE______________________________________________________________________________|        |
   |    |_ _____ __ _identifier-5____________ __ __________________________________________ _|        |
   |      |_NOT_|  |_literal-5_______________|  |_ _THROUGH_ __ _identifier-6____________ _|          |
   |               |_arithmetic-expression-3_|    |_THRU____|  |_literal-6_______________|            |
   |                                                           |_arithmetic-expression-4_|            |
   |                                                                                                  |
   |__________________________________________________________________________________________________|
Operands before the WHEN phrase
Are interpreted in one of two ways, depending on how they are specified:

Operands in the WHEN phrase
Are interpreted in one of two ways, depending on how they are specified:

ALSO
Separates selection subjects within a set of selection subjects; separates selection objects within a set of selection objects.

THROUGH and THRU
Are equivalent.

Two operands connected by a THRU phrase must be of the same class. The two operands thus connected constitute a single selection object.

The number of selection objects within each set of selection objects must be equal to the number of selection subjects.

Each selection object within a set of selection objects must correspond to the selection subject having the same ordinal position within the set of selection subjects, according to the following rules:

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.