ISO2002 Constant Conditional Expression

A constant conditional expression is a conditional expression in which all the operands are literals or arithmetic expressions containing only literal terms. A special form of condition known as a defined condition may also be used as part of a constant conditional expression.

Syntax Rules
  1. A constant conditional expression must be one of the following:
    1. A simple relation condition in which both operands are either literals or arithmetic expressions containing only literal terms and which is formed according to the rules in the topic Relation Condition in the chapter Procedure Division. The following rules also apply:
      1. The operands on both sides of the relational operator must be the same category. An arithmetic expression is of the category numeric.
      2. If literals are specified and they are not numeric literals, the relational operator must be "IS [ NOT ] EQUAL TO" or "IS [ NOT ] =".
    2. A defined condition.
    3. A complex condition as specified in the topic Complex Conditions in the chapter Procedure Division which is formed by combining the above forms of simple conditions into complex conditions. Abbreviated combined relation conditions must not be specified.
General Rules
  1. Complex conditions are evaluated according to the rules in the topic Complex Conditions in the chapter Procedure Division.
  2. For a simple relation condition where the operands are not numeric, no collating sequence is used for the comparison. A character by character comparison for equality is used.

    Note: This means that upper-case and lower-case letters are not equivalent.