Language Reference |
XSECT Function |
The XSECT function returns as a row vector the sorted set (without duplicates) of the element values that are present in all of its arguments. This set is the intersection of the sets of values in its argument matrices. When the intersection is empty, the XSECT function returns a null matrix (zero rows and zero columns). There can be up to 15 arguments, which must all be either character or numeric.
For characters, the element length of the result is the same as the shortest of the element lengths of the arguments. For comparison purposes, shorter elements are padded on the right with blanks.
For example, the following statements return the result shown:
a={1 2 4 5}; b={3 4}; c=xsect(a,b);
C 1 row 1 col (numeric) 4
Copyright © SAS Institute, Inc. All Rights Reserved.