Oct 23, 2019

Where statement

Selects observations from SAS data sets that meet a particular condition.

If it is a big table then using the WHERE statement will improve the efficiency of your SAS programs because SAS is not required to read all observations from the input data set. It will only read matched records from input data set.

Some examples of using operands in WHERE expressions:
  • where number >= 10;>
  • where createDate>='01jan2010'd and createTime>='8:00't;
  • where countryCode='US';
Example:
Data cars; * This step create sas dataset cars in work library;
 Set sashelp.cars; * This reads SAS dataset cars from sashelp library;
  where make='Toyota';*Reads only make='Toyota' cars;
Run;

No comments:

Post a Comment