DGL Statement Reference : IF/THEN/ELSE

IF/THEN/ELSE

Description
Provides conditional execution of template statements.
The IF/THEN/ELSE construct is used for conditional execution of DGL statements. The statements following the THEN (and before any ELSE) are executed if boolean evaluates to TRUE. If it evaluates to FALSE, the statements following ELSE are executed, when present.
Syntax
IF boolean THEN
[statement;]
.
.
.
[ELSE
[statement;]
.
.
.
]
END IF;
Parameters
 
Example
IF a >= b THEN
EXECUTE (’DATE’);
INCLUDE (’sample.txt’);
ELSE
WRITE (’a is less than b’);
END IF;
See Also