Coding conditional expressions

Using the IF and EVALUATE statements, you can code program actions that will be performed depending on the truth value of a conditional expression.

About this task

You can specify the following conditions:

  • Relation conditions, such as:
    • Numeric comparisons
    • Alphanumeric comparisons
    • DBCS comparisons
    • National comparisons
  • Class conditions; for example, to test whether a data item:
    • IS NUMERIC
    • IS ALPHABETIC
    • IS DBCS
    • IS KANJI
    • IS NOT KANJI
  • Condition-name conditions, to test the value of a conditional variable that you define
  • Sign conditions, to test whether a numeric operand IS POSITIVE, NEGATIVE, or ZERO
  • Switch-status conditions, to test the status of UPSI switches that you name in the SPECIAL-NAMES paragraph
  • Complex conditions, such as:
    • Negated conditions; for example, NOT (A IS EQUAL TO B)
    • Combined conditions (conditions combined with logical operators AND or OR)

related concepts  
Switches and flags

related references   
UPSI
  
General relation conditions (COBOL for AIX Language Reference)  
Class condition (COBOL for AIX Language Reference)  
Rules for condition-name entries (COBOL for AIX Language Reference)  
Sign condition (COBOL for AIX Language Reference)  
Combined conditions (COBOL for AIX Language Reference)