ENTER Statement
Transfers control one-way from one cataloged program to another cataloged program.
Syntax
ENTER ctlgName
ENTER @ctlgVar
Syntax Elements
ctlgName The name of a cataloged program.
ctlgVar A variable containing the name of a cataloged program.
Requirements
ENTER transfers control to a DataBasic program that has already been compiled and cataloged. The program executing the ENTER statement must also be cataloged.
All variables to be passed between programs must be declared in COMMON statements in the program transferring control and in the program being entered. All other variables are initialized when the program is entered.
You can ENTER a program that calls a subroutine or external function, but you cannot ENTER a program from a subroutine or external function, or invoke a subroutine or external function with the ENTER statement.
Operation
ENTER works faster than the CHAIN statement. However, if the programs are not cataloged, you must use CHAIN RUN, together with option 'I' if COMMON variables are to passed.
Examples
ENTER PGM1
Executes cataloged program PGM1. Any COMMON variables are passed to PGM1.
I=2 PROGRAM="PGM":I ENTER @PROGRAM
Executes PGM2 and passes any COMMON variables to PGM2.