Previous Page | Next Page

Functions and CALL Routines

COALESCEC Function



Returns the first non-missing value from a list of character arguments.
Category: Character
Restriction: I18N Level 2

Syntax
Arguments
Details
Length of Returned Variable
The Basics
Comparisons
Examples
See Also

Syntax

COALESCEC(argument-1<..., argument-n>)

Arguments

argument

specifies a character constant, variable, or expression.


Details


Length of Returned Variable

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.


The Basics

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.


Comparisons

The COALESCEC function searches character arguments, whereas the COALESCE function searches numeric arguments.


Examples

SAS Statements Results
COALESCEC('', 'Hello')
Hello
COALESCEC ('', 'Goodbye', 'Hello')
Goodbye


See Also

Function:

COALESCE Function

Previous Page | Next Page | Top of Page