Functions and CALL Routines |
Returns the first non-missing value from a list of numeric arguments.
COALESCE(argument-1<..., argument-n>)
|
-
argument
-
specifies a numeric constant, variable,
or expression.
COALESCE accepts
one or more numeric arguments. The COALESCE function checks the value of each
argument in the order in which they are listed and returns the first non-missing
value. If only one value is listed, then the COALESCE function returns the
value of that argument. If all the values of all arguments are missing, then
the COALESCE function returns a missing value.
The COALESCE function searches numeric
arguments, whereas the COALESCEC function searches character arguments.
SAS Statements |
Results |
x = COALESCE(42, .);
|
42
|
y = COALESCE(.A, .B, .C);
|
.
|
z = COALESCE(., 7, ., ., 42);
|
7
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.