From the course: SAS® 9.4 Cert Prep: Part 03 Exploring and Validating Data

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Filtering rows with the WHERE statement

Filtering rows with the WHERE statement

- [Instructor] What if you want to filter the rows that appear in a PROC print report? Or what if you only want to calculate summary statistics for a subset of the data based on a condition? You can use the powerful and flexible WHERE statement to subset your data. The WHERE statement can be used in PROC print, MEANS, FRIQ, UNIVAREA, and many others. The WHERE statement consists of the keyword where followed by one or more expressions. An expression tests the value of a column against a condition that you specify. First, let's look at expressions that use basic operators. We can use any of these operators to compare the value of a column to a value that you specify. The expression evaluates as true or false for each row. You can either use the symbol or letters to represent these operators in an expression. When you specify a value keep in mind that character values are case sensitive and must be enclosed in double or…

Contents