LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (April 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: sas-l@uga.edu
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.


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