( )

Terminates the current Proc and begins execution of another Proc.

Syntax

(file-specifier {item-id}) {label}

Syntax Elements

file-specifier The name of the file containing the Proc to be executed, as defined in Conventions.

The file-name can be the literal file name (not enclosed in quotes) or a direct or indirect reference to a buffer or select register containing it.

The data-section-name can be the literal data section name (not enclosed in quotes) or a direct or indirect reference to a buffer or select register containing it.

item-id The name of the Proc item to be executed.

If item-id is not specified, then the parameter currently pointed to in the active input buffer is used as the item-id.

The item-id can be the literal item-id (not enclosed in quotes) or a direct or indirect reference to a buffer or select register containing the item-id.

label Optionally specifies a label within the called Proc where execution is to commence. Note that a space must precede label in the above syntax. The label in the called Proc is a number at the start of the line containing the command to be executed, and separated from the command by at least one space.

Operation

The ( ) command terminates the current Proc and begins execution of another Proc. This is a one-way transfer only. Control is never returned to the original Proc.

Proc execution begins with the first statement (or the statement preceded by label) in the "chained-to" Proc in the specified file. In order to chain from one Proc to another, the Procs must be of the same type (that is, both PQ or PQN).

The input buffers, output buffers, and file buffers remain unchanged when the ( ) command is executed. All open files remain open. The same information is available to the Proc transferred to.

The ( ) command should be used in MDs to keep items small. The body of the Proc is stored in another file. For example:

PQN
(PROC-FILE TEST-PROC)

This item continues execution with TEST-PROC in the file called PROC-FILE.

The ( ) command can also be used to split up large Procs into smaller units, so that search time for labels can be reduced.

NEVER execute a Proc via the output buffer. Use the ( ) command or the [ ] command instead.

Example 1

PQ
IP?
(PROCEDURES)

This example prompts for the name of a Proc and continues execution with the named Proc in the PROCEDURES file.

Example 2

SET80
001 PQN
002 (PROCLIB)

When SET80 is typed in from TCL, control is passed unconditionally to PROCLIB SET80.

The string 'SET80' is placed in parameter 1 of the primary input buffer (%1).