|
December 2007 Technical Tip – SAS: Special Missing Values The use of missing values in SAS is similar to the use of nulls in relational databases: missing values are used to indicate the absence of a value within an observation. For numeric fields, a missing value is indicated by a period. But SAS also allows "special" missing values for numeric fields. With special missing values we could, for example, record the reason for the absence of a value. In this article I will show you how to use special missing values. Consider the following data step which contains survey data (three responders, three questions, and three possible responses to each question):
Numeric fields can contain a single alphabetic character: these characters are known as special missing values. The MISSING statement is required if special missing values are used. In the above example, M is used to indicate multiple responses (not allowed) and U is used to indicate an unreadable response. "Normal" missing values (period only) are still allowed and in this case would indicate the question was left blank. So how do you select based on special missing values?
If the MISSING option is used in PROC FREQ, you'll get a breakdown for each type of missing value. For example, given (without MISSING):
...the output is as follows:
But given (with MISSING):
...the output is as follows:
We hope you will consider Caliber Data Training when deciding upon a SAS training provider. Go to the articles index. Written by Bill Qualls. Copyright © 2007 by Caliber Data Training 800.938.1222 |