%GOTO

Purpose

Transfers control to a labeled preprocessor statement.

Syntax

%[label:]... GOTO statement-label;

Alternate form: %GO TO for %GOTO.

Parameters

statement-label is a reference to a preprocessor statement.

Description

The %GOTO statement causes the preprocessor to continue its scan at the specified label.

The label following the GOTO specifies the point to which the scan will be transferred. It must be a label of a preprocessor statement.

A preprocessor GOTO statement appearing within a preprocessor procedure cannot transfer control to a point outside of that procedure.

A GOTO statement can transfer control to a label in another included file at an inner level of nesting.

Example

%DECLARE A CHARACTER;
%A = 'NAME';
%GOTO PREP_LABEL;
C = A;
%PREP_LABEL:;           /* Null statement */
D = A;

The text generated by this example would be as follows:

D = NAME;

Restrictions

The label following the GOTO cannot be the label of a preprocessor procedure.