Functions and CALL Routines |
Returns a numeric result that indicates whether the argument contains
a missing value.
Category: |
Descriptive Statistics
|
Category: |
Character
|
Restriction: |
I18N Level 2
|
MISSING(numeric-expression |
character-expression)
|
-
numeric-expression
-
specifies a numeric constant, variable,
or expression.
-
character-expression
-
specifies a character constant, variable,
or expression.
-
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.
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.
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.
|
Functions and CALL Routines:
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.