NET/MASTER Network Control Language (NCL) Reference Manual

PROCEDURE
Core Statements
2–46 106126 Tandem Computers Incorporated
statement
specifies the NCL statement or statements that constitute the procedure.
Execution flows through these statements until NCL encounters one of the
following:
An EXIT statement. Control returns to the caller. The &SYS.RETCODE
system variable can also be set.
A RETURN statement. The RETURN statement returns specified
variables to the caller.
The enclosing END statement. Control returns to the caller with the
return of all shared variables.
END
defines the extent of the procedure. Any NCL statements that follow this operand
are not considered to be part of this procedure.
label
specifies a label. If
label
is used, it must be the same as the label on the
procedure statement. NCL checks these labels during the compilation and
reports an error if they are different.
Considerations
The &SYS.PARMCNT system variable contains the number of arguments
provided by the caller to an NCL procedure. In addition, if the procedure is
initiated by the START or EXEC commands, the &SYS.ALLPARMS system
variable contains the complete string of arguments (excluding leading or trailing
blanks).
The &SYS.NCL.BASEPROC system variable contains the name of the outermost
calling procedure. It is sometimes necessary to pass this information to the called
procedure, which then determines the action to take.
A procedure must either be explicitly CALLED, started from an OCS window, or
started with the CMD core statement or the INTCMD verb.
If NCL encounters a PROCEDURE core statement during execution, all further
statements up to a matching END statement are ignored.
If you refer to a procedure name by a function call in an expression, NCL
generates a compilation error.
See the &SYS.ALLPARMS, &SYS.PARMCNT, &SYS.NCL.BASEPROC, and
&SYS.NCL.CURRPROC system variables in Section 5, “System Variables.”