RPG – IF

IF is used to define conditions for when groups of operation should be performed or not.
ENDIF or END is used to close an IF statement.

ELSEIF can be used in combination with IF to avoid nested IF statements.

ELSE is used in combination with IF to define what should be done if the previous conditions have not been met. 

Example

Example RPGIV Fixed Format