Entering Dates
Understanding Informats for Date Values
In order for SAS to read a value as a
SAS date value, you must give it a set of directions called an informat.
By default, SAS reads numeric variables with a standard numeric informat
that does not include letters or special characters. When a field
that contains data does not match the standard patterns, you specify
the appropriate informat in the INPUT statement.
SAS provides many informats.
Four informats that are commonly used to read date values are:
Note that each informat name ends with a period ...
MMDDYY8.
reads dates written
as mm/dd/yy.
MMDDYY10.
reads dates written
as mm/dd/yyyy.
DATE7.
reads dates in the
form ddMMMyy.
DATE9.
reads dates in the
form ddMMMyyyy.
Get Step-by-Step Programming with Base SAS 9.4 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.