| Date: | Wed, 19 Apr 2006 12:31:54 -0700 |
| Reply-To: | "von-hippel.1@osu.edu" <ptvonhippel@CHECKFREE.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "von-hippel.1@osu.edu" <ptvonhippel@CHECKFREE.COM> |
| Organization: | http://groups.google.com |
| Subject: | precision of datetime values |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
I am working with datetime values that are precise to the millionth of
a second -- e.g.,
data datetimes;
datetime = '17OCT1991:14:45:32.123456'DT;
put datetime=;
run;
I'm a little confused about how such values are stored internally. My
understanding is that, under the hood, a datetime is just a numeric
value. But representing a date like the one above would require 17
digits of precision, and SAS numeric variables have just 16 digits or
precision.
When I print the value as a datetime, it shows 6 significant digits
after the decimal place. But when I print it as numeric, it shows only
5.
proc print data=datetimes;
var datetime;
format datetime datetime25.6;
run;
proc print data=datetimes;
var datetime;
format datetime 17.6;
run;
This makes me wonder what the internal representation reallyis, and
what kind of manipulations will be accurate with a datetime this
precise. Any insights most appreciated.
|