Using Rules functions
The following sections describe general syntax rules for using Rules functions on the Selection Criteria panel (S1), the Advanced Variable Dependencies (ASV) panel, and the Advanced Set Variables (AAV) panel and how to use operators, comparison operators, connector operators, and built-in Rules functions.
Understanding syntax
The following rules apply when coding and evaluating strings or equations:
- White space (blanks) is permitted between operands, operators, and function arguments to improve readability.
- Use single quotation marks before and after any string that you code that contains one or more reserved words, operators, or comparator symbols to have them treated as a literal. Literals specified in this way will be used as is and are not interpreted (resolved). White space can be embedded in literals that use single quotation marks as well. For example:
- 'THIS IS A TEST MESSAGE'
- 'SUBSTR() SHOULD ALWAYS BE = 12'
- Single quotation marks should not be used anywhere in the arguments to a function except when using the VALUE() function. If single quotation marks are needed as the strip character (argument #3) for the STRIP() function, you should use the X() function of X(7D) to do this.
- Side-by-side single quotation marks (no data between them) may be used to specify a null value. The NULL() function can also be used for this purpose. For example, you can test a variable for a null value setting in two ways:
- &MVYVAR<>NULL()
- &MVVAR<>''
- Double quotation marks are not supported. If a double quotation mark is needed, use the X() function of X(7F) instead.
- Built-in Rules functions can be nested. For example, SUBSTR(&WORD1,POS(&WORD1,A),3) is a permitted expression.
- Built-in Rules functions can use a variable as any argument of the function as needed. For example, SUBSTR(&WORD1,&WORD2,4).
- All variable names must be preceded with an ampersand (&) to be considered a variable.
- Built-in Rules function arguments are always separated with a comma (,). The use of a semicolon is not supported.
- All comparisons are done by using like types. You must ensure that each side of the equation is in like type by using built-in Rules functions if necessary; for example:
If both operands are numeric (characters 0-9), a numeric comparison is done. For example, if the equation resolves to 23>10, a numeric comparison is calculated.
The maximum value that can be numerically compared is 2,147,483,647. For values larger than this, the two operands are compared as character strings.
- If one operand contains a real number (has a decimal point and digits to the right of it) and the other operand is numeric, a real number numerical comparison is done.
- If either operand contains non-numeric characters, a simple string comparison is done. Strings of different lengths will have the shorter string padded with blanks to the right to match the longer length operand.
This section contains the following topics:
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*