Returns a numeric result that indicates whether the argument contains a missing value
Category: Descriptive Statistics
Category: Character
MISSING ( numeric-expression character-expression )
numeric-expression
specifies numeric data.
character-expression
is the name of a character variable or an expression that evaluates to a character value.
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 character-expression is defined as having a missing value if the result of the expression contains all blank spaces.
A numeric-expression is defined as having a missing value if the result of the expression is missing (.), or if the expression contains special characters you used to differentiate among missing values. The special characters are the letters A through Z and the underscore , preceded by a period.
The NMISS function requires a numeric argument 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 ;
In this example, the following message appears in the SAS log.
Variable 2 is Missing.
Functions and CALL Routines:
'NMISS Function' on page 664
'CALL MISSING Routine' on page 347