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.
Using special WHERE operators - SAS Tutorial
From the course: SAS® 9.4 Cert Prep: Part 03 Exploring and Validating Data
Using special WHERE operators
- [Instructor] Let's talk about some special where operators that you can use in expressions. Suppose you want to filter your data by missing values. You could write an expression where a column is equal to a period for a numeric missing value or a space enclosed in quotation marks for a character missing value, but a simpler option is to use the is missing or is not missing special operator. This code can be used for either numeric or character missing values. If you happen to be working with data coming from a DBMS environment that distinguishes between missing and null values, there's also an is null operator. The between and operator is handy for numeric and character ranges. The endpoints of the range are inclusive. Finally, the like operator enables us to do pattern matching. The percent symbol is a wildcard for any number of characters and the underscore is a wildcard for a single character. In this example…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Filtering rows with the WHERE statement1m 52s
-
(Locked)
Combining expressions in a WHERE statement58s
-
(Locked)
Demo: Filtering rows with basic operators5m 54s
-
(Locked)
Using special WHERE operators1m 17s
-
(Locked)
Creating and using macro variables2m 6s
-
Demo: Filtering rows using macro variables3m 40s
-
(Locked)
-
-