Sign in

docs RPG Reference

/ELSE

/ELSE

The /ELSE compiler directive is used to unconditionally select source lines to be read following a failed /IF or /ELSEIF test.

See Compiler Directives for information on the columns available for directives.

/ELSE can be specified within any free-form statement other than a free-form calculation statement. See Conditional Directives Within a Free-Form Statement.

The remainder of the line containing /ELSE must be blank.

If the previous /IF or /ELSEIF was not satisfied, source lines are selected until the next /ENDIF.

If the previous /IF or /ELSEIF was satisfied, source lines are excluded until the next /ENDIF.