UPLOAD Procedure
WHERE Statement
Selects observations from SAS data sets.
Syntax
WHERE whereexpression1 <logicaloperator whereexpressionn>;
Syntax Description
 whereexpression1

is a WHERE expression.
 logicaloperator

is one of the following
logical operators:
 whereexpressionn

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:



colon modifier with a comparison
operator


•SUBSTR function (in some
cases)
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)
='characterstring';
An index is used in
processing when all of the following conditions are met:


length is less than or equal to
the length of variable

length is equal to the length of
characterstring
The following example
illustrates using a WHERE statement with the UPLOAD procedure. The
uploaded data set contains only the observations that meet the WHERE
condition.
proc upload data=revenue out=new;
where origin='Atlanta' and revenue < 10000;
run;
Copyright © SAS Institute Inc. All rights reserved.