REXX clauses can be: instructions, null clauses, and labels.
Instructions can be keyword instructions, assignments, or commands.
The following example shows
a program with
these types of clauses. A description of each type of clause follows
the example.
/* QUOTA REXX program. Two car dealerships are competing to */
/* sell the most cars in 30 days. Who will win? */
store_a=0; store_b=0
DO 30
CALL sub
END
IF store_a>store_b THEN SAY "Store_a wins!"
ELSE IF store_b>store_a THEN SAY "Store_b wins!"
ELSE SAY "It's a tie!"
EXIT
sub:
store_a=store_a+RANDOM(0,20) /* RANDOM returns a random number in */
store_b=store_b+RANDOM(0,20) /* in specified range, here 0 to 20 */
RETURN