The statement identified by s is called the terminal statement. It must follow the DO statement in the sequence of statements within the same program unit as the DO statement.
The terminal statement should not be one of the following statements:
Unconditional GO TO
Assigned GO TO
Arithmetic IF
Block IF/ELSE IF
ELSE
END IF
RETURN
STOP
END DO
If the terminal statement is a logical IF statement, it can contain any executable statement, except:
DO/DO WHILE
Block IF/ELSE IF
ELSE IF
ELSE
END IF
END
Logical IF