Comparing Numeric and Nonnumeric Operands
The nonnumeric comparison rules, discussed above, apply. In addition, when
numeric and nonnumeric operands are being compared, their USAGE must be the
same. In such comparisons:
- The numeric operand must be described as an integer literal or data item.
- Noninteger literals and data items must not be compared with nonnumeric operands.
- IBM ExtensionIBM Extension External floating-point items can be compared with nonnumeric operands. End of IBM ExtensionEnd of IBM Extension
If either of the operands is a group item, the nonnumeric comparison rules,
discussed above, apply. In addition to those rules:
- If the nonnumeric operand is a literal or an elementary data item, the numeric operand is treated as though it were moved to an alphanumeric elementary data item of the same size, and the contents of this alphanumeric data item were then compared with the nonnumeric operand.
- If the nonnumeric operand is a group item, the numeric operand is treated as
though it were moved to a group item of the same size, and the contents of
this group item were compared then with the nonnumeric operand.
(See MOVE Statement.)