Language Reference


FIND Statement

  • 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:

range

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.

expression

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.

matrix-name

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Ā 25.136. The default range is all observations.

Figure 25.136: Finding Observations

p
6
7
8
9
10
11
12

p2
14
15
17