NET/MASTER Network Control Language (NCL) Programmer's Guide
Conditional Execution
Controlling Execution Flow
106160 Tandem Computers Incorporated 5–27
The following example shows an NCL procedure that uses the IF statement with the
DO statement:
zex0518n: PROCEDURE
/* IF statement with DO */
&answer = N
get_answer: DO UNTIL &answer = Y
SAY "Enter answer in the OCS command input line (Y/N)"
CMDLINE "-GO ID="&SYS.NCLID _
PAUSE VARS=&1
&answer = SUBSTR(UPPER(&1),1,1)
IF &answer = Y THEN DO
SAY The answer is &1
SAY I like that answer
END /* do */
ELSE DO
SAY "The answer is "&1"!"
SAY "I don’t like that answer"
ITERATE get_answer
END /* do */
END get_answer
END zex0518n
This procedure requests input from the OCS command input line, but it does not take
NO for an answer.
The following screen shows the results of executing the procedure:
(08:20) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0518N
Enter answer in the OCS command input line (Y/N)
|NM1060 PROCEDURE ZEX0518N NCLID 61 PAUSED
The answer is 123!
I don't like that answer
Enter answer in the OCS command input line (Y/N)
|NM1060 PROCEDURE ZEX0518N NCLID 61 PAUSED
The answer is No!
I don't like that answer
Enter answer in the OCS command input line (Y/N)
|NM1060 PROCEDURE ZEX0518N NCLID 61 PAUSED
The answer is YES
I like that answer
NNM1005 START ZEX0518N PROCESSING COMPLETE. NCLID 000061
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
The values entered are 123, No, and YES.