| Functions and CALL Routines |
| Category: | Descriptive Statistics |
| Category: | Character |
| Restriction: | I18N Level 2 |
| Syntax | |
| Arguments | |
| Details | |
| Comparisons | |
| Examples | |
| See Also |
Syntax |
| MISSING(numeric-expression | character-expression) |
| Details |
The MISSING function checks a numeric or character expression for a missing value, and returns a numeric result. If the argument does not contain a missing value, SAS returns a value of 0. If the argument contains a missing value, SAS returns a value of 1.
A numeric expression is considered missing if it evaluates to a numeric missing value: ., ._, .A, ..., .Z.
A character expression is considered missing if it evaluates to a string that contains all blanks or has a length of zero.
| Comparisons |
The MISSING function can have only one argument. The CMISS function can have multiple arguments and returns a count of the missing values. The NMISS function requires numeric arguments and returns the number of missing values in the list of arguments.
| Examples |
This example uses the MISSING function to check whether the input variables contain missing values.
data values; input @1 var1 3. @5 var2 3.; if missing(var1) then do; put 'Variable 1 is Missing.'; end; else if missing(var2) then do; put 'Variable 2 is Missing.'; end; datalines; 127 988 195 ; run;
SAS writes the following output to the log:
Variable 2 is Missing.
| See Also |
|
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.