10.14.7 If - Then - Else (IF)

Syntax

IF condition THEN statement1 [ELSE statement2]

Statement1 and statement2 can be any valid statement as described at the beginning of the section on statements.

Purpose

The IF statement is used to make a decision based upon some condition. The action of this statement is as follows:

evaluate the condition

if the result of the condition is nonzero (true),

do statement1

if the result of the condition is zero (false),

do statement2 if specified.

Example:

IF last_pdate LT $todays_date-30 THEN

DO overdue_acct;

ELSE

DO current_acct;