PROC, short for procedure, allows executing a series of TCL and other commands from a single word command. Everything that can be done in TCL can be done in PROC. Procs also are used to avoid repetitively typing the same series of commands, interact with the user, and to test or verify input information from the user.
PROC has the following features:
Interactive terminal prompting
Four variable length I/O buffers
Extensive I/O and buffer control commands
Parameter passing between the buffers
Free-field and fixed-field character manipulation
Relational character testing
Pattern matching
Conditional and unconditional branching
Optional command labels
User defined subroutine linkage
Inter-Proc linkage
Use of the PROC processor is much the same as using a JCL on mainframe systems. However, PROC language is more versatile since it can interactively prompt the user for responses and can branch on conditional statements. In addition, Proc can verify the user’s input.
A Proc is a series of instructions that are interpreted by the PROC system processor.
Procs are executed interpretively by the PROC processor; they do not need to be compiled. Procs are stored as dictionary items, or as items in a data file. Procs that are in the current master dictionary can be executed by typing the name at the TCL prompt. While the Proc definition must be in the master dictionary, the actual body of the Proc may reside as an item in any dictionary or data file. Attribute 1 of a Proc is always the pq code.
Once a Proc is invoked, it remains in control until it completes or until it is explicitly terminated. A Proc can temporarily relinquish control to another processor, such as a subroutine or the Update processor, but it regains control when that process ends. The system only returns to TCL when the Proc is deliberately terminated or when the Proc ends.
D3 allows a sequence of commands to be prestored in a Proc and then started by a single word. Any sequence of operations that can be executed at TCL can be prestored by the PROC processor. This prestored sequence of operations is executed (interpreted) by the PROC processor.