|How to Represent Missing Values in Raw Data|
Representing Missing Values shows how to represent each type of missing value in raw data so that SAS will read and store the value appropriately.
|Missing Values||Representation in Data|
|Numeric||. (a single decimal point)|
|Character||' ' (a blank enclosed in quotes)|
|Special||. letter (a decimal point followed by a letter, for example, .B)|
|Special||._ (a decimal point followed by an underscore)|
|How to Set Variable Values to Missing in a DATA Step|
Note: You can display a missing numeric value with a character other than a period by using the DATA step's MISSING statement or the MISSING= system option.
Alternatively, if you want to set to a missing value for one or more variable values, you can use the CALL MISSING routine. For example,
sets both variable values to a missing value.
Note: You can mix character and numeric variables in the CALL MISSING routine argument list.
|How to Check for Missing Values in a DATA Step|
You can use the N and NMISS functions to return the number of nonmissing and missing values, respectively, from a list of numeric arguments.
If your data contains special missing values, you can check for either an ordinary or special missing value with a statement that is similar to the following:
To check for a missing character value, you can use a statement that is similar to the following:
The MISSING function enables you to check for either a character or numeric missing value, as in:
In each case, SAS checks whether the value of the variable in the current observation satisfies the condition specified. If it does, SAS executes the DO group.