CHAIN Statement

The CHAIN statement terminates execution of a program and executes a TCL command.

Format

CHAIN command-expr

Parameter(s)

command-expr

Any command to be passed to TCL.

Description

Like the EXECUTE statement, the CHAIN executes a TCL command. The CHAIN statement differs from the EXECUTE statement, however, in that it does not support any of EXECUTE’s features (such as capturing output or error messages), and it does not return to the program, but returns directly to the environment which called the program.

If the CHAIN statement is used to execute another program, parameters cannot be directly passed to the second program. However, if the I option (which suppresses initialization of all values) is used with the RUN command, the COMMON area may be used to pass parameters from one program to the next. See COMMON Statement for more information.

The data stack may be used to supply input which the TCL command might request. See DATA Statement for more information.

Example

To end a program by running another program, WRAPUP, the code might read:

CHAIN "RUN BP WRAPUP"

See Also

Statement and Function Reference