Program Control

REXX has instructions such as DO, IF, and SELECT for program control. Here is a typical REXX IF instruction:

if a>1 & b<0 then do
    say "Whoops, A is greater than 1 while B is less than 0!"
    say "I'm ending with a return code of 99."
    exit 99
end

C programmers will notice that the REXX relational operator for a logical AND is different from the operator in C (which is &&). Other relational operators differ as well, so you'll want to review the appropriate section in the Object REXX Reference. For now, here's a list of some common comparison operators and operations: