NET/MASTER Network Control Language (NCL) Programmer's Guide
Conditional Execution
Controlling Execution Flow
5–28 106160 Tandem Computers Incorporated
Using the IF Statement With the NOP Statement
You must follow the THEN keyword by a statement. You cannot follow the THEN
keyword by a null statement. However, you can use the NOP core statement to
explicitly specify no action.
The following example shows an NCL procedure that uses the IF statement with the
NOP statement:
zex0519n: PROCEDURE
/* IF statement with NOP */
SAY "Enter 2 characters"
CMDLINE "-GO ID="&SYS.NCLID _
PAUSE VARS=&1
IF LENGTH(&1) = 2 THEN
NOP
ELSE DO
SAY "You entered "&1
SAY "The length of "&1" is not 2"
END
END zex0519n
This procedure requests input from the OCS command input line. If the length of the
input is 2, the procedure terminates with no message. If not, the procedure terminates
with a message.
The following screen shows the results of executing the procedure twice:
(11:58) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0519N
Enter 2 characters
|NM1060 PROCEDURE ZEX0519N NCLID 2005 PAUSED
You entered ABC
The length of ABC is not 2
NNM1005 START ZEX0519N PROCESSING COMPLETE. NCLID 002005
START ZEX0519N
Enter 2 characters
|NM1060 PROCEDURE ZEX0519N NCLID 2006 PAUSED
You entered
The length of is not 2
NNM1005 START ZEX0519N PROCESSING COMPLETE. NCLID 002006
START ZEX0519N
Enter 2 characters
|NM1060 PROCEDURE ZEX0519N NCLID 2007 PAUSED
NNM1005 START ZEX0519N PROCESSING COMPLETE. NCLID 002007
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The values entered are ABC (incorrectly), a null value (incorrectly), then two
characters are entered (correctly).