NET/MASTER Network Control Language (NCL) Reference Manual
BOOLEXPR
Built-in Functions
106126 Tandem Computers Incorporated 4–21
In the following example, &b contains an invalid value. NCL raises a run-time error
(26), which reports an error in parameters passed to a built-in function:
&a = "ABCD"
&b = "ZZZZ"
&result = BOOLEXPR( "&a IS ALPHANUM",, &b )
In the following example, the value of &a is evaluated to determine if it contains a
valid date format (specified by DATE1). The result is false, so NCL returns a value
of 0 (zero):
&a = "ABCD"
&result = BOOLEXPR( "&a IS DATE1" )
In the following example, the value of &a is evaluated to determine if it is both
numeric (specified by NUM) and equal to 5. After the numeric evaluation (before the
AND operator), the result is false, so processing stops and NCL returns a value of 0
(zero):
&a = "ABCD"
&result = BOOLEXPR( "&a IS NUM AND &a = 5" )
In the following example, the value of &a is evaluated to determine if it is either
numeric (specified by NUM) or equal to 5. However, the value of &a is nonnumeric.
This is a data error, so NCL returns a value of BAD:
&a = "ABCD"
&result = BOOLEXPR( "&a IS NUM OR &a = 5" )
In the following example, the value of &a is evaluated to determine if its type is other
than Y, YES, y, or yes (specified by y); N, NO, n, or no (specified by n); or a valid
binary value (specified by bin). The result is true, so NCL returns a value of 1:
&a = "ABCD"
&types = "y,n,bin"
&result = BOOLEXPR( "&a IS NOT &types" )
In the following example, the value of &a is evaluated to determine if it contains
alphanumeric characters and hexadecimal characters, and if it is a valid date format.
The result is true, so NCL returns a value of 1:
&a = "930210"
&type1 = "ALPHANUM"
&type2 = "DATE7"
&type3 = "HEX"
&result = BOOLEXPR( "&a IS ALL &type1,&type2,&type3" )
In the following example, the value of &a is evaluated to determine if it exactly
matches ABCD (the letters in the right operand are converted to uppercase). The
result is true, so NCL returns a value of 1:
&a = "ABCD"
&result = BOOLEXPR( "&a LIKE 'abcd' FOLD" )