The syntax for a scan expression shows words such as ALL, ANY, FIELDS, and VALUES. These words are used to indicate options in scan tests. Although it might appear that these are reserved words, and thus cannot be used as field names, or unquoted field values, this is not the case.
Note: For more information about the syntax for a scan expression, see the &NDBSCAN verb description in the Network Control Language Reference Guide.
There are no reserved words in the syntax for a scan expression.
All keywords are resolved by context. That is, if a certain keyword is allowed at a point in the expression, the presence of that keyword at that point in an expression is regarded as being that keyword. At any other point, that keyword is regarded as a name, value, and so on.
For example, the following are valid scan expressions. Keywords are shown in bold typeface. (Assume that field names and so on are defined.)
FIELD ALL = VALUE ANY ANY FIELDS VALUE, FIELD, ALL CONTAINS ALL VALUES FIELD, + VALUE, ANY
This can cause some confusion. Obviously, fields names of FIELD, ALL, and so on, are not recommended.
When generating scan expressions dynamically, it is always a good idea to insert all the optional keywords, to prevent a syntax error when, for example, a search value of FIELDS is provided. For example:
&NDBSCAN ... DATA FIELD1 = &SCHVALUE
If the variable &SCHVALUE contained the characters FIELDS, without the quotes, the scan would fail with a syntax error, as the keyword FIELDS is not followed by a field name.
To prevent this, the previous example could be coded:
&NDBSCAN ... DATA FIELD1 = VALUE &SCHVALUE
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |