O'Reilly logo

Step-by-Step Programming with Base SAS 9.4 by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:
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.
Note that each informat name ends with a period ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required