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
- A constant conditional expression must be one of the following:
- 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:
- The operands on both sides of the relational operator must be the same category.
An arithmetic expression is of the category numeric.
- If literals are specified and they are not numeric literals, the relational
operator must be "IS [ NOT ] EQUAL TO" or "IS [ NOT ] =".
- A defined condition.
- 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
- Complex conditions are evaluated according to the rules in the topic Complex
Conditions in the chapter Procedure Division.
- 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.