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 (February 2000, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 17 Feb 2000 10:13:49 +0100
Reply-To:     detecsm_hellriegelg@WESTLB.DE
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gehard Hellriegel <detecsm_hellriegelg@WESTLB.DE>
Subject:      Re: Odd Date Errors
Content-type: text/plain; charset=us-ascii

I had no problems with: data test; input d: mmddyy9.; format d date9.; cards; 123195 10198 ; run;

data test; length x $10; x="123195"; y=input(x,mmddyy9.); output; x="10195"; y=input(x,mmddyy9.); output; format y date9.; run;

Be sure, that your YEARCUTOFF option is ok (something > 1910)

Kyle Dane <kyledane@MY-DEJA.COM> on 16.02.2000 20:57:09

Bitte antworten an Kyle Dane <kyledane@MY-DEJA.COM>

An: SAS-L@LISTSERV.UGA.EDU Kopie: (Blindkopie: DeTeCSM HellriegelG/D/ExternalStaff/WLB) Thema: Odd Date Errors

I'm wondering if anyone has had the problem I'm having or can see what I'm doing wrong. My data came to me as a SAS data set with several variables that have unformatted dates that appear as follows:

12/31/95 looks like 123195; 1/1/95 like 10195

I've tried two methods of converting these dates to formatted SAS dates: 1) converted the unformatted dates to a character variable, substringed out the two digit month, day and year into three separate variables and converted to SAS date using the mdy function. 2) used the input function with an embedded put statement. Like this: sasdate=input(put(origdate,z6.),mmddyy6.);

In both cases, my resulting sasdates are coming out wrong in many cases, but only wrong by one to three days. The months and years are always correct, but the days are wrong as often as they are right. So far, I have found none that are any more than 3 days off.

I considered that it might be a Y2K problem, but I've ruled that out as a possibility by looking at the underlying SAS elapsed date.

Does anyone have an idea what might be going on with the data or my program?

-- Kyle Dane Programmer/Analyst - UCSF Division of Geriatrics kdane@medicine.ucsf.edu - 415-514-0714

Sent via Deja.com http://www.deja.com/ Before you buy.

Mit freundlichen Gruessen

DeTeCSM, Gerhard Hellriegel

WestLB Abteilung: 001-80622 Aderstr. 22 D - 40217 Duesseldorf Tel.: +49211 826 6173 Fax: +49211 826 5393


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