Determining values

The execution of the EVALUATE statement operates as if each selection subject and selection object were evaluated and assigned a numeric, alphanumeric, DBCS, or national character value; a range of numeric, alphanumeric, DBCS, or national character values; or a truth value.

These values are determined as follows:

  • Any selection subject specified by identifier-1, identifier-2, ... and any selection object specified by identifier-3 or identifier-5 without the NOT or THRU phrase are assigned the value and class of the data item that they reference.
  • Any selection subject specified by literal-1, literal-2, ... and any selection object specified by literal-3 or literal-5 without the NOT or THRU phrase are assigned the value and class of the specified literal. If literal-3 or literal-5 is the figurative constant ZERO, QUOTE, or SPACE, the figurative constant is assigned the class of the corresponding selection subject.
  • Any selection subject in which expression-1, expression-2, ... is specified as an arithmetic expression, and any selection object without the NOT or THRU phrase in which arithmetic-expression-1 or arithmetic-expression-3 is specified, are assigned numeric values according to the rules for evaluating an arithmetic expression. (See Arithmetic expressions.)
  • Any selection subject in which expression-1, expression-2, ... is specified as a conditional expression, and any selection object in which condition-1 or condition-2 is specified, are assigned a truth value according to the rules for evaluating conditional expressions. (See Conditional expressions.)
  • Any selection subject or any selection object specified by the words TRUE or FALSE is assigned a truth value. The truth value "true" is assigned to those items specified with the word TRUE, and the truth value "false" is assigned to those items specified with the word FALSE.
  • Any selection object specified by the word ANY is not further evaluated.
  • If the THRU phrase is specified for a selection object without the NOT phrase, the range of values includes all values that, when compared to the selection subject, are greater than or equal to the first operand and less than or equal to the second operand according to the rules for comparison. If the first operand is greater than the second operand, there are no values in the range.
  • If the NOT phrase is specified for a selection object, the values assigned to that item are all values not equal to the value, or range of values, that would have been assigned to the item had the NOT phrase been omitted.