Executing a Proc

Calling entries

A Proc is executed by entering the name of the corresponding Master Dictionary (MD) item at the TCL prompt. Procs can also be executed from another Proc of the same type via the ( ) command, which passes control to the second Proc, or the [ ] command, which calls the second Proc as a subroutine. Further ways in which Procs can be executed are when called from DataBasic (via a PERFORM or CHAIN statement that executes a TCL command that executes the Proc), as a Logon Control Program, and via the GO command.

The main part of a Proc should not be stored in the account's MD, especially if large. One reason for this is that everything (including commands and files) is accessed via the MD and, if excessively cluttered with Procs, both access and execution times are increased. Procs are usually stored as items in a separate file created solely for Procs, say PROCFILE, with calling entries in the MD.

For example, to call the Proc named TESTING in file PROCFILE, the MD entry should be:

     TESTING
001  PQN
002  (PROCFILE TESTING)

Proc control

Once a Proc is invoked, it remains in control until it is exited or control is passed to another Proc. Even when the Proc temporarily relinquishes control to a processor such as EDITOR or DataBasic, it still remains in control, because an exit from the called processor returns control to the Proc. TCL regains control if: