SETCALCULATE directive
Performs Boolean set calculations on the contents of vectors or pointers.
Options
Parameter
Description
The SETCALCULATE directive allows you to perform set operations. The calculation must have a single assignment, setting a pointer, variate, text or factor to the result of a set calculation involving other compatible structures. Calculations on pointers must involve only pointers, those on variates and those on texts can involve factors, while those on factors can involve either variates or texts but not both.
For example, you can form a variate All that contains all the distinct values that occur in either of a pair of variates x and y using the .OR. operator
SETCALCULATE all = x .OR. y
or all the (distinct) values that occur in both of them using the .AND. operator
SETCALCULATE both = x .AND. y
The available operators are as follows:
The NULL option can save a scalar whose value is 1 if the calculation generates an null set (i.e. one that has no members); otherwise the scalar is set to 0. The FREPRESENTATION option determines whether the values of factors are compared using their levels or their labels; by default the levels are used. The final option, TOLERANCE, defines the tolerance to be used when comparing numbers. The default value 10-6 should be suitable, however, unless the variates contain very small values.
Options: NULL, FREPRESENTATION, TOLERANCE.
Parameter: unnamed.
Action with
RESTRICT
SETCALCULATE ignores any restrictions on vectors in the expression.