Program Control Statements and Procedures

The following table lists statements and a procedure that affect program control.

Statements

Name

Description

CASE

Within a SELECT CASE structure, marks a block of statements that are executed if an associated value matches the SELECT CASE expression.

CONTINUE

Often used as the target of GOTO or as the terminal statement in a DO loop; performs no operation.

CYCLE

Advances control to the end statement of a DO loop; the intervening loop statements are not executed.

DO

Evaluates statements in the DO loop, through and including the ending statement, a specific number of times.

DO WHILE

Evaluates statements in the DO WHILE loop, through and including the ending statement, until a logical condition becomes .FALSE..

ELSE

Introduces an ELSE block.

ELSE IF

Introduces an ELSE IF block.

ELSEWHERE

Introduces an ELSEWHERE block.

END

Marks the end of a program unit.

END DO

Marks the end of a series of statements following a DO or DO WHILE statement.

END FORALL

Marks the end of a series of statements following a block FORALL statement.

END IF

Marks the end of a series of statements following a block IF statement.

END SELECT

Marks the end of a SELECT CASE statement.

END WHERE

Marks the end of a series of statements following a block WHERE statement.

EXIT

Leaves a DO loop; execution continues with the first statement that follows.

FORALL

Controls conditional execution of other statements.

GOTO

Transfers control to a specified part of the program.

IF

Controls conditional execution of other statements.

PAUSE

Suspends program execution and, optionally, executes operating-system commands.

SELECT CASE

Transfers program control to a block of statements, determined by a controlling argument.

STOP

Terminates program execution.

WHERE

Controls conditional execution of other statements.

Procedure

Name

Description

EXIT

(Intrinsic Subroutine) Terminates the program, flushes and closes all open files, and returns control to the operating system.

The portability routines RAISEQQ, SIGNALQQ, and SLEEPQQ also supply this functionality.