Date: Wed, 27 Feb 2002 14:23:08 -0500
Reply-To: Dianne Rhodes <RHODESD1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dianne Rhodes <RHODESD1@WESTAT.COM>
Subject: Re: Coalesce
Content-Type: text/plain; charset="iso-8859-1"
Now I have an excuse to read my Joe Celko book :
The COALESCE(<value expression>...<value expression>) function scans the
list of <value expressions> from left to right and returns the first
non-NULL value in the list. If all the <value expressions> are NULL, the
result is NULL. This is the same function, under a new name, as the
VALUE<value expression>...<value expression>) in DB2 and other SQL
implementations based on DB2. (p 57)
>From: Michael L. Davis [mailto:michael@BASSETTCONSULTING.COM]
>Sent: Wednesday, February 27, 2002 1:54 PM
>Subject: Re: Coalesce
>I'm sure is it documented somewhere but here is my
>understanding of the
>Coalesce function. Consider the following example:
> newstuff=coalesce(updt_var, hist_var) ;
>If updt_var is non-missing, newstuff is equal to updt_var. Otherwise,
>newstuff is equal to hist_var.
>- Michael "Mad Doggy" Davis
>At 08:51 AM 2/27/2002 -0800, Myra Oltsik <myra@DATASQUARE.COM> wrote:
>>I got a copy of an SQL query from someone to show me how he extracted
>>data. It has the function COALESCE in it. Thought the SAS On-line
>>documentation mentions it, the doc doesn't define it. From what I can
>>tell, it concatenates two variables/columns into one. Am I correct?
>Michael L. Davis
>Bassett Consulting Services, Inc.
>10 Pleasant Drive
>North Haven CT 06473-3712