LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 5 Oct 2009 13:00:22 -0400
Reply-To:     Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:      Re: adjusting dates
Content-Type: text/plain; charset=ISO-8859-1

I'd prefer the following, if YEARDATE is char:

d = mdy(1,1,input(yeardate,10.))

reason: d SHOULD be numeric to represent a date-value, not char. Gerhard

On Mon, 5 Oct 2009 12:47:52 -0400, Phil Busby <fransioli@HOTMAIL.COM> wrote:

>From: E Joas <erikjoas@GMAIL.COM> >Subject: adjusting dates > >Hello, >I have a problem with dates in SAS. > >I have a variable that gives the date of an event in years (yyyy) now >I want that to be transformed into a full date (yyyymmdd), all the >observations would be given the date XXXX0101. > >How do I do that? > >thanks for the help >Erik Joas > >Erik: > >If yeardate is numeric, > >FULLDATE = MDY(1,1,YEARDATE); > > > >If yeardate is character, > > > >FULLDATE = YEARDATE || '0101'; > >Phil > > > _________________________________________________________________ Hotmail: Trusted email with Microsoft�s powerful SPAM protection.

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