NET/MASTER Network Control Language (NCL) Reference Manual
MASKCHK
Built-in Functions
4–54 106126 Tandem Computers Incorporated
Considerations
A mask is any combination of characters used as a reference string in the
comparative testing of the contents of another supplied string. Each character of
the mask is compared with each character of the supplied string, from left to right,
to provide one of the four possible results defined previously. A wild-card
character in the mask is accepted by NCL as equivalent to any character in the
string.
See also ABBREV, which tests a string for a valid abbreviation.
Examples
In the following example, NCL returns a value of EQ because the mask ABC is equal
to the string. No wild-card character is used:
&A = ABC
&B = ABC
&RESULT = MASKCHK(&A,&B)
In the following example, NCL returns a value of NE for both SAY statements, because
in both cases the mask A is a different size from the string and no wild-card character
is used:
SAY MASKCHK(A,ABC)
SAY MASKCHK(ABC,A)
In the following example, NCL returns a value of EQ because the mask AB**EF* is
equal to the string. Default wild-card characters (asterisks) are used:
SAY MASKCHK("AB**EF*",ABCDEFG)
In the following example, NCL returns a value of EQS because the data matches the
mask ABC*, but the data is shorter than the mask. The default wild-card character is
used:
SAY MASKCHK(ABC"*",ABC)
In the preceding two examples, the default wild cards (asterisks) must be enclosed in
quotes to avoid NCL interpreting them as arithmetic operators.
In the following example, NCL returns a value of EQL because the data matches the
mask ABC#, but the data is longer than the mask. The wild-card character “#” is used:
&A = ABC#
&B = ABCDEF
&C = #
&RESULT = MASKCHK(&A,&B,&C)