Functions and CALL Routines |
Returns the first non-missing value from a list of character arguments.
COALESCEC(argument-1<..., argument-n>)
|
-
argument
-
specifies a character constant, variable,
or expression.
In a DATA step,
if the COALESCEC function returns a value to a variable that has not previously
been assigned a length, then that variable is given a length of 200 bytes.
COALESCEC accepts
one or more character arguments. The COALESCEC 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 COALESCEC function
returns the value of that argument. A character value is considered missing
if it has a length of zero or if all the characters are blank. If all the
values of all arguments are missing, then the COALESCEC function returns a
string with a length of zero.
The COALESCEC function searches character
arguments, whereas the COALESCE function searches numeric arguments.
SAS Statements |
Results |
COALESCEC('', 'Hello')
|
Hello
|
COALESCEC ('', 'Goodbye', 'Hello')
|
Goodbye
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.