Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
WHERE where-expression-1
<logical-operator where-expression-n>; |
You can use SAS functions in a WHERE expression. Also, note that a DATA or a PROC step attempts to use an available index to optimize the selection of data when an indexed variable is used in combination with one of the following:
To understand when use of the SUBSTR function causes an index to be used, look at the format of the SUBSTR function in a WHERE statement:
where substr(variable, position, length) = 'character-string';
An index is used in processing when all of the following conditions are met:
The following example illustrates using a WHERE statement with the DOWNLOAD procedure. The downloaded data set contains only the observations that meet the WHERE condition.
proc download data=revenue out=new; where origin='Atlanta' and revenue < 10,000; run;
For more information about the WHERE statement, refer to SAS Language Reference: Dictionary.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.