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 (September 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 19 Sep 2008 15:31:42 -0400
Reply-To:     Dominc Mitchell <mitchell.d@VIDEOTRON.CA>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Dominc Mitchell <mitchell.d@VIDEOTRON.CA>
Subject:      Re: merging databases with dates
Comments: To: Ya Huang <ya.huang@AMYLIN.COM>
In-Reply-To:  <200809191858.m8JGmuCe016267@malibu.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"

Hi,

I guess you generate a number that would be like your yyyyydaycount format along those lines:

data test; format date yymmddn8.; date=mdy(2,5,2008); Newdate=year(date)*1000 + ( date - mdy(1,1,year(date)) +1 ); run; proc print; run;

The SAS System 15:25 Friday, September 19, 2008 3

Obs date Newdate

1 20080205 2008036

Regards,

Dominic.

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ya Huang Sent: Friday, September 19, 2008 2:58 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: merging databases with dates

So for a string of '2008122', would you interpret it as 22JAN2008 or 02DEC2008? I don't think SAS is smart enough to figure that out :-)

On Fri, 19 Sep 2008 14:32:36 -0400, Dennis Tomashek <dennist2@UWM.EDU> wrote:

>I have to sas databases that I need to merge. It is a many-to-many merge, >and thus need to use dates as two of the matching variables. The problem is >that one database has a $8 format (yyyymmdd), and the other has a $7 format >(yyyydaycount). SO Feb 5, 2008 would look like '20080205' in the first >database, and 2008036 in the second. Can I reformat one of the databases, or >convert both using an extraction and mdy process? Any clues would be greatly >appreciated. > >Thank you


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