NET/MASTER Network Control Language (NCL) Programmer's Guide

Introducing NCL Procedures and Functions
Procedures and Functions
106160 Tandem Computers Incorporated 6–5
The LENGTH built-in function provides the length of the data contained in &A. The
length is used as the starting position from which to extract the substring from the
data in &B.
The result of executing this procedure is the following:
345
The following example uses the ABBREV, SPACE, and UPPER built-in functions:
zex0603n: PROCEDURE NOFOLD
/* ABBREV, SPACE, and UPPER built-in functions */
/* Check first character of &SYS.ALLPARMS is Y */
&result = ABBREV( UPPER( SPACE( &SYS.ALLPARMS ) ), Y )
IF &result == 1 THEN
SAY You entered &SYS.ALLPARMS correctly
ELSE
SAY You entered &SYS.ALLPARMS incorrectly
SAY The result is &result
END zex0603n
The procedure strips spaces from a string, converts alphabetic characters in the string
to uppercase letters, and tests whether the first character of the string is the letter Y.
The string, which is contained in the system variable &SYS.ALLPARMS, is entered
when the procedure is executed. If the first character of the string is “y” or “Y,” the
string is entered correctly; otherwise, incorrectly.
The following screen shows the results of executing the procedure twice: first, when
the string is entered correctly; then incorrectly:
(14:52) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0603N yabc
You entered yabc correctly
The result is 1
NNM1005 START ZEX0603N PROCESSING COMPLETE. NCLID 000359
START ZEX0603N zabc
You entered zabc incorrectly
The result is 0
NNM1005 START ZEX0603N PROCESSING COMPLETE. NCLID 000360
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>