Reading Date and Time Values | |
How SAS Software Stores Date
Values |
Before you read date or time values into a SAS data set or use those
values in calculations, you should understand how SAS software stores date
and time values.
When you read a date using a SAS informat, SAS software converts it to a numeric date value. A SAS date value is the number of days from January 1, 1960, to the given date. |
Here are some examples of how the appropriate SAS informat can convert different expressions for the date January 2, 2000, to a single SAS date value: |
Date Expression | SAS Date Informat | SAS Date Value |
---|---|---|
02Jan00 | DATEw. | 14611 |
01-02-2000 | MMDDYYw. | 14611 |
02/01/00 | DDMMYYw. | 14611 |
2000/01/02 | YYMMDDw. | 14611 |
Storing dates and times as numeric values enables you to use dates and times in calculations much as you would any other number. |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.