Data set options are used in conjunction with the data set name to control the creation or reading of the data set. Data set options are enclosed in parentheses following the name of the data set.
The drop= or keep= options are used in the creation of a
new data set and specify variables used in the data step which are
dropped from (or kept in) the data set itself. Example:
data dumb(drop=x y);
input x y z;
cards;
...
run;
The data set dumb will contain only the varible z. The
keep= option behaves similarly.
Similar behavior can be obtained by using the drop and keep statements. The data set options are preferred.
The additional options firstobs=, obs=, and where=
control how the data set is read. These options, together with drop=
and keep=, are most often used in the proc
step to restrict analysis to certain observations in the data set.
The where= option can not be used when firstobs= or
obs= is used.
Examples:
proc means data=dumb(where=(x<5 and y>9) drop=z);
run;
proc means data=dumb(firstobs=5 obs=20);
run;
The first example analyzes only the observations in dumb for
which the two restrictions are met. Similar behavior can be obtained
using the where statement.
The second example analyzes only observations 5 through 20 of the data
set dumb.
Copyright © 1997 by Jerry Alan Veeh. All rights reserved.