NET/MASTER Network Control Language (NCL) Programmer's Guide
Execution Techniques
Executing NCL Procedures
106160 Tandem Computers Incorporated 8–5
An example of a command you may want to replace with an NCL procedure is the
LIST command. You may want to write an NCL procedure that strips the message
numbers from the beginning of each line of an NCL procedure as the line is displayed.
The following example shows an NCL procedure that does this:
list: PROCEDURE
CONTROL NOCMD
INTCLEAR
/* Execute LIST command within NCL procedure */
INTCMD "LIST "&1
INTREAD VARS ( &text ) TYPE=ANY PARSE=NO WAIT=10
&msgno = SUBSTR(&text,1,7)
DO WHILE ( &msgno = 'NNM1018' )
SAY SUBSTR(&text,9)
INTREAD VARS ( &text ) TYPE=ANY PARSE=NO WAIT=10
&msgno = SUBSTR(&text,1,7)
END
SAY &text
END list
After you write the NCL procedure, you can replace the NonStop NET/MASTER MS
command using the SYSPARMS CMDREPL command. You can use the SYSPARMS
UNLOAD command to unload a preloaded NCL procedure.
The following command replaces the LIST command with an NCL procedure of the
same name:
SYSPARMS CMDREPL=LIST
The following screen illustrates the use of SYSPARMS CMDREPL and SYSPARMS
UNLOAD:
(11:56) --------------------- OPERATOR CONTROL SERVICES ----------------------
LIST ZEX0801N
NNM1018 zex0801n: PROCEDURE
NNM1018 SAY "Parameter 1 is "&1
NNM1018 SAY "Parameter 2 is "&2
NNM1018 SAY "Overlaying "&1" with "&2" is: "OVERLAY(&1,&2,,,"*")
NNM1018 END zex0801n
NNM1019 LIST $DATA2.ZNCLPGN.ZEX0801N PROCESSING COMPLETE
SYSPARMS CMDREPL=LIST
NNM0604 SYSPARMS CMDREPL=LIST OPERAND ACCEPTED
NNM1061 LIST NOW CMDREPLED
START LIST ZEX0801N
zex0801n: PROCEDURE
SAY "Parameter 1 is "&1
SAY "Parameter 2 is "&2
SAY "Overlaying "&1" with "&2" is: "OVERLAY(&1,&2,,,"*")
END zex0801n
NNM1019 LIST $DATA2.ZNCLPGN.ZEX0801N PROCESSING COMPLETE
NNM1005 START LIST PROCESSING COMPLETE. NCLID 000018
SYSPARMS UNLOAD=LIST
NNM1057 UNLOAD OF LIST ACCEPTED
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>