NET/MASTER Network Control Language (NCL) Reference Manual

&SYS.NCL.NEST
System Variables
5–60 106126 Tandem Computers Incorporated
&SYS.NCL.NEST The &SYS.NCL.NEST system variable contains the nesting level number of the current
procedure or function. When an NCL procedure is invoked, the first procedure
executed is called the base procedure. If the base procedure calls another procedure or
function, the second procedure and any further procedures or functions that are called
become nested.
Any procedure or function may use &SYS.NCL.NEST to determine the nesting level
number at which it is executing. Counting starts from the base procedure, which has a
nesting level of 0 (zero). Every time a procedure or function is called, 1 is added to
&SYS.NCL.NEST; every time the procedure or function returns, 1 is subtracted from
&SYS.NCL.NEST.
A maximum of 128 nesting levels is allowed in a single NCL process.
&SYS.NCL.NEST
Example
In the following example, the &SYSMSG variable is assigned a message indicating that
the maximum nesting level has been reached:
IF &SYS.NCL.NEST = 128 THEN
&SYSMSG ="Maximum nesting level".