Constant conditional expressions

A constant conditional expression is an expression that is specified in conditional compilation directives and evaluated during the processing of those directives to determine the text that is included in the resultant program.

Note: In this topic, "literals" also include compilation variables, which means that you can use compilation variables in constant conditional expressions.

A constant conditional expression shall be one of the following items:
  • A relation condition in which both operands are literals or arithmetic expressions that contain only literal terms. The condition shall follow the rules for relation conditions, with the following additions:
    • The operands shall be of the same category. An arithmetic expression is of the category numeric.
    • If literals are specified and they are not numeric literals, the relational operator shall be “IS EQUAL TO”, “IS NOT EQUAL TO”, “IS =”, or “IS NOT =”.
  • A defined condition.
  • A boolean condition.
  • A complex condition formed by combining the above forms of simple conditions into complex conditions by using AND, OR, and NOT. Abbreviated combined relation conditions shall not be specified.