NET/MASTER Network Control Language (NCL) Reference Manual

&SYS.NCL.BASEPROC and &SYS.NCL.CURRPROC
System Variables
5–58 106126 Tandem Computers Incorporated
&SYS.NCL.BASEPROC and &SYS.NCL.CURRPROC
The &SYS.NCL.BASEPROC system variable contains the name of an NCL base
procedure; &SYS.NCL.CURRPROC contains the name of the procedure currently
executing. When an NCL procedure is invoked, the first procedure executed is called
the base procedure. If the procedure is not nested, both system variables have the
same contents (the name of the procedure currently executing). If the base procedure
calls another procedure or function, the second procedure and any further procedures
or functions that are called become nested.
&SYS.NCL.BASEPROC and &SYS.NCL.CURRPROC should be used for an executing
procedure in which a message from the procedure refers to the name of a possible
calling procedure. If this is done, and either procedure is subsequently renamed, no
modification to the code is required.
When calling a nested procedure to perform a utility function, common self-adjusting
error messages can be issued that correctly refer to the names of calling procedures.
The value returned for both variables is a name, containing up to eight characters.
&SYS.NCL.BASEPROC
&SYS.NCL.CURRPROC
Example
In the following example, the &SYS.NCL.CURRPROC and &SYS.NCL.BASEPROC
system variables are PROC2 and MAIN_PROC, respectively. In this example, there
are calls to two NCL procedures:
MAIN_PROC: PROCEDURE
CALL PROC1
EXIT
PROC1: PROCEDURE
CALL PROC2
EXIT
END PROC1
PROC2: PROCEDURE
SAY "BASE PROC = " &SYS.NCL.BASEPROC
SAY "CURRENT PROC = " &SYS.NCL.CURRPROC
END PROC2
END MAIN_PROC