Chapter 3: Converting Dates and Times into SAS Date, Time, and Datetime Values

3.1 Avoiding the Two-Digit Year Trap

3.2 Using Informats

3.3 The INFORMAT Statement

3.4 Listing and Discussion of Informats

In Chapter 2, I discussed translating SAS dates to the way we express them. How can we do the reverse? After all, if you have a date, time, or date and time that you need to store or manipulate, it won't be represented as a SAS date, time, or datetime value (unless it comes from another SAS data set). The translation from common date and/or time terminology to SAS is almost as easy as going the other way, and it is done in one of two ways: The first, discussed in Section 1.4, uses date, time, and datetime literals. While this works for a small ...

Get The Essential Guide to SAS Dates and Times, Second Edition, 2nd 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.