From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Using a generic informat to read dates

Using a generic informat to read dates

- [Instructor] Dates can be written as text strings in many different ways. A special informat you can use to read a variety of dates is the ANYDTDTE informat. You might be thinking, "Why not always use it "instead of the specific date informats "such as date or MMDDYY?" One reason is that it does take a bit longer to process the values with the ANYDTDTE informat. You also might prefer to use a particular informat to ensure that converted dates all follow a designated layout. But it's good to know you have this option if you are unsure about the format of incoming dates or you're reading a column that has dates written in various ways. One thing to note when you use this informat if the date is ambiguous such as 6/01/2018 which could be interpreted as either June 1st or January 6th, SAS uses the DATESTYLE= system option to determine the order of month, day, and year. The default value for the DATESTYLE= option is LOCALE.…

Contents