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

Conditional Execution
Controlling Execution Flow
106160 Tandem Computers Incorporated 5–33
The following screen shows the results of executing the procedure twice:
(12:14) --------------------- OPERATOR CONTROL SERVICES ----------------------
START ZEX0522N "abc"
Value of &1 is abc
SIMPLE SELECT 1st WHEN
STRICT SELECT 2nd WHEN
NNM1005 START ZEX0522N PROCESSING COMPLETE. NCLID 002013
START ZEX0522N " abc"
Value of &1 is abc
SIMPLE SELECT 1st WHEN
STRICT SELECT 1st WHEN
NNM1005 START ZEX0522N PROCESSING COMPLETE. NCLID 002015
_____________________________________________________________________________
---------- ------------------ NonStop NET/MASTER D30 ---------------- --------
M=>
When the procedure is executed for the first time, the parameter “abc” is entered
without blanks. Blanks are not significant to the simple SELECT group and so the first
WHEN clause in this group is executed, even though the expression following WHEN
has blanks within the quotes. Blanks are significant to the strict SELECT group, and so
the second WHEN clause is executed—the parameter does not match the expression
following the first WHEN keyword.
When the procedure is executed for the second time, the parameter “ abc” is entered
with blanks. Blanks are not significant to the simple SELECT group, and so the first
WHEN clause is executed again. Blanks are significant to the strict SELECT group,
and so the first WHEN clause is executed.
Using the SELECT Statement With the DO Statement
The execution path following the WHEN and OTHERWISE keywords can execute a
single statement or a group of statements. If you want to execute a group of
statements following the WHEN or OTHERWISE keywords, you must enclose the
group of statements with the DO and END statements.