Previous Page | Next Page

SAS Component Language Dictionary

GOTO



Branches immediately to another entry
Category: Control Flow

Syntax
Details
Example
See Also

Syntax

CALL GOTO(entry<,action<,frame>>);

entry

is the name of the entry to branch to. The entry can be any of the SAS/AF display entry types (FRAME, PROGRAM, MENU, CBT, or HELP). The entry argument can be in the following forms:

entry

to specify a PROGRAM entry in the current catalog.

entry.type

to specify an entry in the current catalog.

libref.catalog.entry

to specify a PROGRAM entry in a different catalog.

libref.cat-name.entry.type

to specify an entry in a different catalog.

Type: Character

action

specifies how the execution stack is to be handled and where control transfers to when the specified entry ends:

'A'

adds entry to the top of the execution stack. The specified entry is displayed immediately. When the entry ends, the user returns to the window that was displayed before the program with the CALL GOTO was executed.

'C'

clears the current execution stack. The specified entry is displayed immediately, and the stack is cleared. When the entry ends, the user returns to the parent entry, if one was specified in the entry, or exits the AF window. This option may be useful if you have memory constraints. (This is the default.)

'R'

removes the top entry from the execution stack and places the entry specified in the GOTO routine on the top of the execution stack. The specified entry is displayed immediately. When the entry ends, the user returns to the next entry on the stack rather than to the program that contains the GOTO call.

Type: Character

frame

is the number of the CBT frame if you are branching to a CBT entry.

Type: Numeric


Details

The GOTO routine branches immediately to a CBT, HELP, MENU, FRAME, or PROGRAM entry and transfers control to it. Statements that appear after GOTO are not executed, because control is transferred to the entry that is specified in the GOTO routine.

GOTO, which always starts a new stream, cannot be used in FSEDIT or FSVIEW programs.


Example

Pass control to MYEND.PROGRAM, and end the SAS/AF session if the user issues the END command. Assume there is no parent entry specified.

if _status_='E'
then call goto('myend.program','C');


See Also

DISPLAY

Previous Page | Next Page | Top of Page