Use the WHERE clause to conditionally select observations from within the specified range. The following statements create
a matrix to contain the variables Age
, Height
, and Weight
for females in the Sashelp.Class
data set:
use Sashelp.Class; read all var _num_ into Female where(sex="F"); print Female;
The section Process Data by Using the WHERE Clause describes other features of the WHERE clause. For example, you can create a matrix to contain the student names that begin with the letter "J," by using the following statements:
read all var {Name} into J where(name=:"J"); print J;