Date: Wed, 14 May 2003 13:38:57 -0400
Reply-To: Ed Heaton <EdHeaton@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ed Heaton <EdHeaton@WESTAT.COM>
Subject: Re: Dates from the first Century
Content-Type: text/plain
Dave.
I agree that SAS isn't thinking about dates the way I think about dates, but
obviously 03150044 is not the same as 03151944. I think this is a bug.
Consider this
Data _null_ ;
x = input("03/15/0044" , mmddyy10. ) ;
Put x= mmddyy10. ;
Run ;
SAS claims that Julius Caesar was killed in the 20th century! It should
report that SAS won't handle dates before 1582 rather than giving us the
wrong date when we explicitely use a four-digit year for a first-century
date.
Ed
Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1600 Research Boulevard, Room RW-3541, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 610-5128
mailto:EdHeaton@westat.com http://www.westat.com
-----Original Message-----
From: Dave Andrae [mailto:daandrae@yahoo.com]
Sent: Wednesday, May 14, 2003 1:32 PM
To: Ed Heaton
Subject: Re: Dates from the first Century
Ed,
This (SAS 8.2 PC):
DATA ED;
ATTRIB X FORMAT=MMDDYY10.;
x = input( "03150044" , mmddyy10. ) ;
OUTPUT;
x = input( "01010100" , mmddyy10. ) ;
OUTPUT;
x = input( "12310099" , mmddyy10. ) ;
OUTPUT;
RUN;
PROC PRINT
DATA=ED;
RUN;
results in:
The SAS System 12:21
Wednesday, May 14, 2003 7
Obs X
1 03/15/1944
2 .
3 12/31/1999
I don't think SAS is "thinking" about the dates the way you think it
is.
HTH,
Dave
--- Ed Heaton <EdHeaton@WESTAT.COM> wrote:
> Okay, why doesn't
>
> x = input( "03150044" , mmddyy8. ) ;
>
> set X to missing?
>
> x = input( "01010100" , mmddyy8. ) ;
>
> sets X to missing and gives a note that the argument is invalid.
> This I expect because SAS has no date before 1582. This I expect.
> But why don't I get a similar result from
>
> x = input( "12310099" , mmddyy8. ) ;
>
> I know why not ... but why not?
>
> Ed
>
> Edward Heaton, Senior Systems Analyst,
> Westat (An Employee-Owned Research Corporation),
> 1600 Research Boulevard, Room RW-3541, Rockville, MD 20850-3195
> Voice: (301) 610-4818 Fax: (301) 610-5128
> mailto:EdHeaton@westat.com http://www.westat.com
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|