Multiple comparisons are separated by ANDs or ORs to form a logical expression. (Alternatively, & and | may be used for AND and OR). When evaluating an expression, each comparison cn is evaluated first. Then, AND conditions are evaluated before OR conditions.
Parentheses may be used around groups of comparisons to change the default evaluation order. Any number of nested parentheses may be used. Conditions within parentheses are evaluated first, from innermost to outermost parentheses.
For example, if you wanted to select all records from your Paris office for 1995 and
1996, you might incorrectly
specify:
INCLUDE COND=(1,4,CH,EQ,C'1995',OR,1,4,CH,EQ,C'1996', AND,5,5,CH,EQ,C'PARIS')
The AND operator in the above statement would be evaluated first, producing unexpected
output. The correct statement would
be:
INCLUDE COND=((1,4,CH,EQ,C'1995',OR,1,4,CH,EQ,C'1996'), AND,5,5,CH,EQ,C'PARIS')
The added parentheses force the OR operator to be evaluated first, thus producing the expected output.