FIND
<range> <WHERE(expression)> INTO matrix-name ;
The FIND statement finds the observation numbers in range that satisfy the conditions of the WHERE clause. The FIND statement places these observation numbers in the numeric matrix whose name follows the INTO keyword.
The arguments to the FIND statement are as follows:
specifies a range of observations. You can specify a range of observations by using the ALL, CURRENT, NEXT, AFTER, and POINT keywords, as described in the section Process a Range of Observations.
specifies a criterion by which certain observations are selected. The optional WHERE clause conditionally selects observations that are contained within the range specification. For details about the WHERE clause, see the section Process Data by Using the WHERE Clause.
names a matrix to contain the observation numbers.
The following statements are valid examples of the FIND statement:
use Sashelp.Class; find all where(name=:"J") into p; find point (10:18) where(age>14) into p2; print p, p2; close Sashelp.Class;
The column vectors p
and p2
contain the observation numbers that satisfy the WHERE clause in the given range, as shown in Figure 24.134. The default range is all observations.