A general relation condition compares two operands, either of which can be an identifier, literal, arithmetic expression, or index-name.
Relational operator | Can be written | Meaning |
---|---|---|
IS GREATER THAN | IS > | Greater than |
IS NOT GREATER THAN | IS NOT > | Not greater than |
IS LESS THAN | IS < | Less than |
IS NOT LESS THAN | IS NOT < | Not less than |
IS EQUAL TO | IS = | Equal to |
IS NOT EQUAL TO | IS NOT = | Not equal to |
IS GREATER THAN OR EQUAL TO | IS >= | Is greater than or equal to |
IS LESS THAN OR EQUAL TO | IS < | Is less than or equal to |
IDENTIFICATION DIVISION. PROGRAM-ID. COBRELAC. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC 9(9). 01 B PIC 9(9). PROCEDURE DIVISION. A000-FIRST-PARA. MOVE 15 TO A. MOVE 20 TO B. IF A IS GREATER THAN OR EQUAL TO B THEN DISPLAY 'A IS GREATER THAN B' ELSE DISPLAY 'A IS LESS THAN B' END-IF. STOP RUN. |
A IS LESS THAN B |
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!