Creating Special Missing Values
Definition
special missing value
is a type of numeric missing value that enables you to represent different categories
of missing data by using the letters A–Z or an underscore.
Tips
SAS accepts either uppercase or lowercase letters. Values are displayed and printed
as uppercase.
If you do not begin a special numeric missing value with a period, SAS identifies it
as a variable name. Therefore, to use a special numeric missing value in a SAS
expression or assignment statement, you must begin the value with a period,
followed by the letter or underscore. For example:
x=.d;
When SAS prints a special missing value, it prints only the letter or underscore.
When data values contain characters in numeric fields that you want SAS to interpret
as special missing values, use the MISSING statement to specify those characters.
For further information, see the “MISSING Statement” in SAS Global Statements:
Reference.
Example
The following example uses data from a marketing research company. Five testers were
hired to test five different products for ease of use and effectiveness. If a tester was
absent, there is no rating to report, and the value is recorded with an X for “absent.” If
the tester was unable to test the product adequately, there is no rating, and the value is
recorded with an I for “incomplete test.” The following program reads the data and
displays the resulting SAS data set. Note the special missing values in the first and third
data lines:
data period_a;
missing X I;
input Id $4. Foodpr1 Foodpr2 Foodpr3 Coffeem1 Coffeem2;
datalines;
1001 115 45 65 I 78
1002 86 27 55 72 86
1004 93 52 X 76 88
1015 73 35 43 112 108
1027 101 127 39 76 79
;
proc print data=period_a;
title 'Results of Test Period A';
footnote1 'X indicates TESTER ABSENT';
footnote2 'I indicates TEST WAS INCOMPLETE';
84 Chapter 5 Missing Values

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.