Reading Date and Time Values |
Lesson
Summary![]() ![]() |
This page contains |
|
I. Text Summary
To go to the page where a task, programming feature, or concept was presented, select a link. In this lesson you learned how SAS software stores date and time values, as well as how to input common date and time expressions using SAS informats. You also saw how SAS date values can be used in computations or as arguments in SAS functions. |
How SAS Stores Date and Time Values SAS software stores date values as numeric SAS date values, which are the number of days from January 1, 1960. SAS time values are the number of seconds since midnight. |
Reading Dates and Times Using Informats Use SAS informats to read date and time expressions and convert them to SAS date and time values.
Two-digit year values require special consideration. When a two-digit year value is read, SAS software defaults to a year within a 100-year span determined by the YEARCUTOFF= system option. The default value of YEARCUTOFF= is 1920. You can check or reset the value of your session to use a different 100-year span for date informats. |
Using Dates and Times In Calculations Date and time values can be used in equations like other numeric values. In addition to tracking time intervals, SAS date and time values can be a part of SAS functions and complex calculations. |
II. Syntax
To go to the page where a statement or option was presented, select a link. |
OPTIONS YEARCUTOFF=yyyy; DATA=SAS-data-set; INFILE raw-data-file; RUN; |
|
III. Sample Program
options yearcutoff=1920; data perm.aprbills; infile aprdata; input LastName $8. @10 DateIn mmddyy8.
|
IV. Points to Remember
|
![]() |
![]() |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.