Chapter Contents |
Previous |
Next |
In the SAS System, you can use a WHERE expression in the following situations:
proc print data=employees; where startdate > '01jan1990'd; run;
proc print data=employees (where=(startdate > '01jan1990'd)); run;
proc sql; select state from crime where murder > 7;
where age > 15
proc sql; create view stat as select * from crime where murder > 7;
In some cases, you can combine the methods that you use to specify a WHERE expression. That is, you can
For example, it might be useful to combine methods when you merge data sets. That is, you might want different criteria to apply to each data set when you create a subset of data. However, when you combine methods to create a subset of data, there are some restrictions. For example, in the DATA step, if a WHERE statement and a WHERE= data set option apply to the same data set, the data set option takes precedence. For details, see the documentation for the method you are using to specify a WHERE expression.
Note: By default,
a WHERE expression does not evaluate added and modified observations. To specify
whether a WHERE expression should evaluate updates, you can specify the WHEREUP=
data set option. See the WHEREUP= data set option in SAS Language Reference: Dictionary.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.