The main operation of a Proc is to move data from one of the two input buffers into one of the two output buffers to perform the desired TCL commands.
When a Proc starts or when control returns to a Proc, the primary input buffer is selected automatically as the active buffer. It contains the Proc name and any additional arguments entered when the Proc was invoked. The contents of this buffer remain the same throughout the execution of the Proc, unless specifically modified.
Data from several system processors, such as the spooler, are also placed in the secondary input buffer. For example, the last hold file entry number is placed in this buffer. The secondary input buffer is a very temporary entity, and if its contents are to be used, they should be used immediately subsequent to the execution of the processor that loaded the buffer.
The primary output buffer is used to construct a single TCL command. A carriage return is placed automatically at the end of the command in the buffer when the p command is issued.
The secondary output buffer (stack) is used to hold zero or more lines of data, which are used by other processors called by the Proc generated TCL command. Each request for terminal input is satisfied with a line of data from the stack. In the event that the called processor requests more data than exists in the stack, data is requested from the terminal. Note that the stack is really a first in, first out queue. Each line of data must be terminated by a carriage return and must be placed in the stack explicitly via an h command.
After all data has been moved to the buffer, control is passed to the primary output buffer via the p command. The command stored in the primary output buffer is executed at the TCL level and the data in the secondary output buffer, if any, is used to feed processors such as AQL. When the process ends, control returns to the Proc at which time new data may be moved to the output buffers.
|Primary Input Buffer
The primary input buffer is the point through which all keyboard input passes between the operator and the Proc being executed. The sp and s PROC commands activate the primary input buffer.
The primary input buffer has ’word’ positions. Each ’word’ position is delimited by a space. Each character string separated by a space is called a ’word’ and can be manipulated independently.
|Primary Output Buffer
|The primary output buffer is where commands are constructed that are subsequently passed to TCL for processing.
|Secondary Input Buffer
|The secondary input buffer is used exclusively for holding the item-IDs of error messages returned by processes executed by PROC. The ss PROC command activates the secondary input buffer.
|Secondary Output Buffer
|The secondary output buffer is used to store strings that are subsequently passed to TCL for processing, after the contents of the primary output buffer have been processed. A number of commands are used on the secondary output buffer and are linked to this item. The ston or st on PROC command invokes the secondary output buffer.