SAS Date and Time Values

Definitions

SAS date value
is a value that represents the number of days between January 1, 1960, and a specified date. SAS can perform calculations on dates ranging from 1582 C.E. to 19,900 C.E.. Dates before January 1, 1960, are negative numbers; dates after are positive numbers.
SAS Date Values
  • SAS date values account for all leap year days, including the leap year day in the year 2000.
  • SAS date values are based on the Gregorian calendar, and they are valid for the dates supplied above. SAS Date Values
  • Various SAS language elements handle SAS date values: functions, formats, and informats.
SAS time value
is a value representing the number of seconds since midnight of the current day. SAS time values are between 0 and 86400. SAS Time Values
SAS datetime value
is a value representing the number of seconds between January 1, 1960, and an hour/minute/second within a specified date. SAS makes adjustments for leap years, but ignores leap seconds. SAS does not make adjustments for daylight saving time.

Example: Date and Time Values

SAS stores date values as numbers so that you can easily sort the values or perform arithmetic computations. You can use SAS date values as you use any other numeric values.
data work.test; 
  set cert.temp; 
  TotDay=enddate-startdate; 
run;
proc print data=work.test; 
run;
Output 13.1 PROC PRINT Output of Work.Test (partial output)
Partial Output: PROC PRINT of Work.Test with TotDay variable.
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.107.254