Chapter Contents

Previous

Next
Statements with the Same Function in Multiple Procedures

WHERE


Subsets the input data set by specifying certain conditions that each observation must meet before it is available for processing.

WHERE where-expression;


Required Arguments

where-expression
is a valid arithmetic or logical expression that generally consists of a sequence of operands and operators. See SAS Language Reference: Dictionary for more information on where processing.


Procedures That Support the WHERE Statement
You can use the WHERE statement with any of the following base SAS procedures that read a SAS data set:

CALENDAR RANK
CHART REPORT
COMPARE SORT
CORR SQL
DATASETS (APPEND statement) STANDARD
FORMS TABULATE
FREQ TIMEPLOT
MEANS/SUMMARY TRANSPOSE
PLOT UNIVARIATE
PRINT


Details


Example
In this example, PROC PRINT prints only those observations that meet the condition of the WHERE expression. The DEBATE data set is created in Example: Temporarily Dissociating a Format from a Variable .

   options nodate pageno=1 linesize=64 
           pagesize=40;
   proc print data=debate noobs;
      where gpa>3.5;
      title 'Team Members with a GPA'; 
      title2 'Greater than 3.5';
   run;
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.