## 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:
```
```
• Individually, they are called selection subjects
• Collectively, they are called a set of selection subjects.
```
```
Operands in the WHEN phrase
Are interpreted in one of two ways, depending on how they are specified:
```
```
• Individually, they are called selection objects
• Collectively, they are called a set of selection objects.
```
```
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:
```
```
• Identifiers, literals, or arithmetic expressions appearing within a selection object must be valid operands for comparison to the
X corresponding operand in the set of selection subjects. For
X comparisons involving date fields, see "Date Fields" in
X topic 6.1.6.4.1.
```
```
• Condition-1, condition-2, or the word TRUE or FALSE appearing as a selection object must correspond to a conditional expression or the word TRUE or FALSE in the set of selection subjects.
```
```
• The word ANY can correspond to a selection subject of any type.
```
```
• X Where identifiers are permitted, they can reference date field, DBCS,
X floating-point, USAGE POINTER, USAGE PROCEDURE-POINTER, or USAGE IS
X OBJECT REFERENCE or USAGE PROCEDURE-POINTER data items.
```
```
• X Where nonnumeric literals are permitted, DBCS literals are permitted.
```
```
• X Where numeric literals are permitted, floating-point literals are
X permitted.
```
```

Subtopics:

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