Determining if an expression is true or false is useful in your procedures. If an expression is true, the computed result is 1. If an expression is false, the computed result is 0. The following shows some ways to check for true or false operators.
Comparisons - Some operators you can use for comparisons are:
>
Comparisons can be made with numbers or can be character-to-character. Some numeric comparisons are:
The value of 5 > 3 is 1
If the terms being compared are not numbers, the interpreter compares characters. For example, the two words (strings) airmail and airplane when compared character for character have the first three letters the same. Since m < p, airmail < airplane.
Equal - An equal sign (=) can have two meanings in REXX, depending on its position. For example,
amount = 5 /* This is an assignment */
gives the variable amount, the value of 5. If an equal sign is in a statement other than as an assignment, it means the statement is a comparison. For example,
SAY amount = 5 /* This is a comparison */
compares the value of amount with 5. If they are the same, a 1 is displayed, otherwise, a 0 is displayed.
For more examples of using comparisons, select the Examples pushbutton.