CL Programming


Using the TFRCTL Command

In the following illustration, if Program A is specified with USRPRF(*OWNER), the owner's authorities are in effect for all of the programs shown. If Program B is specified with USRPRF(*OWNER), the owner's authorities are in effect only while Programs B and C are active. When Program B transfers control to Program D, Program B is no longer in the call stack and the owner of Program B is no longer considered for authorization during the running of Program D. When the programs complete processing (by returning or transferring control), the owner's authorities are no longer in effect. Any overrides issued by Program B remain in effect while Program D is running and are lost when Program D does a return.
In this illustration, if Program A is specified with USRPRF(*OWNER), the owner's authorities are in effect for all of the programs shown. If Program B is specified with USRPRF(*OWNER), the owner's authorities are in effect only while Programs B and C are active. When Program B transfers control to Program D, Program B is no longer in the call stack and the owner of Program B is no longer considered for authorization during the running of Program D. When the programs complete processing (by returning or transferring control), the owner's authorities are no longer in effect. Any overrides issued by Program B remain in effect while Program D is running and are lost when Program D does a return.

The TFRCTL command has the following format:

TFRCTL PGM(library-name/program-name) PARM(CL-variable)

The program (and library qualifier) may be a variable.

It is important to note that only variables may be used as parameter arguments on this command, and that those variables must have been received as a parameter in the argument list from the program that called the transferring program. That is, the TFRCTL command cannot pass a variable that was not passed to the program running the TFRCTL command.

In the following example, the first TRFCTL is valid. The second TFRCTL command is not valid because &B was not passed to this program. The third TFRCTL command is not valid because a constant cannot be specified as an argument.

PGM PARM(&A)
DCL &A *DEC 3
DCL &B *CHAR 10
IF (&A *GT 100) THEN (TFRCTL PGM(PGMA) PARM(&A)) /*   valid   */
IF (&A *GT 50) THEN (TFRCTL PGM(PGMB) PARM(&B))  /* not valid */
ELSE (TFRCTL PGM(PGMC) PARM('1'))                /* not valid */
ENDPGM

The PARM parameters are discussed under Passing Parameters between Programs and Procedures.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]