Chapter Summary

Text Summary

How SAS Stores Date and Time Values

SAS stores dates as numeric SAS date values, which represent the number of days from January 1, 1960. SAS time values are the number of seconds since midnight.

Reading Dates and Times with Informats

Use SAS informats to read date and time expressions and convert them to SAS date and time values.
  • MMDDYYw. reads dates such as 053090, 05/30/90, or 05 30 1990.
  • DATEw. reads dates such as 30May1990, 30May90, or 30-May-1990.
  • TIMEw. reads times such as 17:00, 17:00:01.34, or 2:34.
  • DATETIMEw. reads dates and times such as 30May1990:10:03:17.2, 30May90 10:03:17.2, or 30May1990/10:03.
Two-digit year values require special consideration. When a two-digit year ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.