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.

Extracting data from a Datetime value

Extracting data from a Datetime value

- [Instructor] There are many formats that you can use to display both the date and time component of a SAS datetime value, but what if you want to separate the date or time value and create new columns? You can do this with either the DATEPART or TIMEPART function. For both functions, the only required argument is a SAS datetime value. The functions return raw SAS date and SAS time numeric values, and you can apply a format to improve the display.

Contents