To execute the command that has been built in the primary output buffer.
P{P}{H}{Ln}{X}
P displays the command and prompts to continue.
H suppresses (hushes) any terminal output that would be generated by the processed command.
Ln sets an execution lock (from 0 through 255), so that anyone else using the same Proc (or a Proc or program that sets the same lock) cannot execute at the same time.
If the lock is already set, the Proc waits until it is released. The lock set by PLn is cleared once the TCL command in the output buffer has been executed.
The H and Ln options can be combined as PHLn.
X terminates the Proc after the command executes. X cannot be used with any other options.
The simple command form P passes the contents of the output buffer(s) to TCL for processing.
Caution
Only TCL commands should be processed with the P command. Do not try to execute a Proc by placing the name of the Proc in the primary output buffer and issuing the P command. Use a Proc transfer command ( ) or [ ] to execute another Proc from within a Proc.
When the P command is executed, control is passed to TCL and, upon completion of the command, control returns to the Proc for any further processing. Commands and data in the secondary output buffer are made available to interactive processors.
If a command is in the primary output buffer when a Proc terminates, it is executed. For example, the WHERE command is executed when the following Proc is run:
001 PQN 002 MV #1 "WHERE"
The 'PP' versions (PP, PPH, PPLn, and PPHLn) of the P command are generally used as debugging tools. These operate similarly to the P versions, but the contents of both output buffers are displayed before processing and prompt you with a question mark (?). Valid responses are:
Y
or return to process the Proc.S
to cancel the command and continue execution of the Proc.N
to abort the TCL command, exit the Proc, and return to TCL.After the P command has been processed, both output buffers are cleared, and the stack is turned off. This is also true if a PP command is followed by an S or N response.
HLIST INV DESC QTY P
This example moves the English command (LIST INV DESC QTY) to the output buffer and executes it.
HCOPY INVOICE 132 STON H(BACKORDER X132< PP
This example moves the COPY command to the primary output buffer. STON turns the stack on. The next command places the response to the TO: prompt into the secondary input buffer. PP prints the contents of both buffers and prompts for the continuation response.