Previous Page | Next Page

The DOWNLOAD Procedure

WHERE Statement


Selects observations from SAS data sets.
Restrictions: The DOWNLOAD procedure processes WHERE statements when you transfer a single SAS data set.
See also: WHERE Statement Syntax in SAS Language Reference: Dictionary


Syntax

WHERE where-expression-1 <logical-operator where-expression-n>;

where-expression-1

is a WHERE expression.

logical-operator

is one of the following logical operators:

AND

AND NOT

OR

OR NOT

where-expression-n

is a WHERE expression.

WHERE statements allow multiple WHERE expressions that are joined by logical operators.

You can use SAS functions in a WHERE expression. Also, note that a DATA step 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 using 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 < 10000;
run;

For details, see the WHERE statement in SAS Language Reference: Dictionary.

Previous Page | Next Page | Top of Page