Skip to main content

Re: SAS command for filtering observations

HUD.GOV HUDUser.gov
eList

"Manny & Hilary" <manny_hilary@sbcglobal.net> wrote:
>>I am trying to filter out observations that meet certain criteria with regards to income, rent, etc.  I am new to SAS and didn’t know if there was a simple
command or string of code that would enable the user to do this.<<

Check your SAS documentation for the WHERE command. For example, if you wanted just owner-occupied units, you could specify:

WHERE Status = '1' AND Tenure = '1';

This can be used in both DATA and PROC steps. It can also be used as a data set option:

DATA OWNERS;
SET AHS.AHS2001
(WHERE = (Status = '1' AND Tenure = '1'));

etc.

Dav Vandenbroucke
Economist
U.S. Dept. HUD
david_a._vandenbroucke@hud.gov
202-708-1060 ext. 5890