The TFRCTL command replaces one program with another program at the same call level. The program to which control is transferred runs at the same call level as the program that contained the TFRCTL command. An override command in a program that transfers control to another program is not deleted during the transfer of control.
In the following example, program A transfers control to program B, and program B runs in the same call level as program A. The Override with Database File (OVRDBF) command causes the file to be positioned at the last record of the member when it is opened and is used for both programs A and B.
CALL PGM(A)
Program A
OVRDBF FILE(INPUT) POSITION(*END)
(INPUT is opened and positioned at the last
record of the member and closed after
processing.) TFRCTL PGM(B)
Program B
(INPUT is opened and positioned at the last
record of the member.)