CL Command Reference - TFRCTL
CL Command List > TFRCTL Reference
Description:
The Transfer Control (TFRCTL) command calls the specified program, passes control to it, and removes the transferring program from the return stack. Because the transferring program is removed from the call stack, control does not return to it when the called program returns control. Instead, control is returned to the command following the last call to the transferring program.
Restrictions:
. This command is valid only within original program model (OPM) CL programs.
. You must have object operational (*OBJOPR) and execute (*EXECUTE) authorities to the program to be called, and *EXECUTE authority to the library where the program is located.
. The TFRCTL command is threadsafe, meaning that it can be used to call a program when the TFRCTL command is run in a job with multiple threads. No checking is done whether or not the program to be called is threadsafe.
Examples:
TFRCTL PGM(PROGA) PARM(&PARM1)
This command transfers control to the program PROGA and passes the parameter &PARM1 to it. The parameter &PARM1 must previously have been passed to the program issuing this command.