BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a DATETIME variable that looks like 15NOV2007:09:08:00. I want to separate the Date and Time into separate variables. How do I do this while keeping the formatting. Thanks.
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
Use the DATEPART and TIMEPART functions to extract the pertinent pieces and then apply the appropriate formats to the resulting variables.
deleted_user
Not applicable
Thanks. I found the function about an hour after I posted.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 2 replies
  • 1565 views
  • 0 likes
  • 2 in conversation