NET/MASTER Network Control Language (NCL) Programmer's Guide
Getting Started With Functions
An NCL Tutorial
3–26 106160 Tandem Computers Incorporated
The USERW2 NCL
Procedure
The CUBE user-written function produces the cube of the number 2. With some minor
changes, however, we can create a much more useful function. Let us create a new
NCL procedure, USERW2, with a new user-written function, called CUBE, to produce
the cube of any number, as shown in the following listing:
userw2: PROCEDURE
WRITE DATA="Cube of "&1" is: "CUBE(&1)
cube: FUNCTION
RETURN(&1**3)
END cube
END userw2
Follow the steps described earlier in this section to create, test compile, correct, and
execute USERW1 with one exception: execute USERW2 three times using the
following three commands:
START USERW2 5
START USERW2 11
START USERW2 17
To do so, follow these steps:
1. Type START USERW2 5 at the OCS command input line and press the ENTER
key.
2. Type START USERW2 11 at the OCS command input line and press the ENTER
key.
3. Type START USERW2 17 at the OCS command input line and press the ENTER
key.