LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 25 Nov 2008 09:27:16 -0500
Reply-To:     Akshaya Nathilvar <akshaya.nathilvar@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Akshaya Nathilvar <akshaya.nathilvar@GMAIL.COM>
Subject:      Re: use of the coalesce() function
Comments: To: RolandRB <rolandberry@hotmail.com>
In-Reply-To:  <bfb90334-8dc3-4136-8605-f9c67de1e81d@z1g2000yqn.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

How about using IFN function along with COALESCE function. datetime=dhms(date,0,0,coalesce(ifn(time>0,time,0),0));

Akshaya

On Tue, Nov 25, 2008 at 9:12 AM, RolandRB <rolandberry@hotmail.com> wrote:

> I'd never heard of the coalesce() function before today. It returns > the first non-missing value from a list of arguments. I wanted to > create a datetime value from a date and a time. The time might be > missing or in rare cases negative but must be used if non-missing. If > missing then 0 should be used. > > datetime=dhms(date,0,0,coalesce(time,0)); >


Back to: Top of message | Previous page | Main SAS-L page