BookmarkSubscribeRSS Feed
5062917
Calcite | Level 5

Hi,

I have a dataset where dates are stored as a character in the format, MMM DD YYYY, 00:00, e.g."Jun 26 2015, 08:38" or "Apr 9 2015, 20:15". Is there any way to turn this into a numeric date?

 

 

Thanks in advance 🙂 

2 REPLIES 2
novinosrin
Tourmaline | Level 20
data have;
k="Apr 9 2015, 20:15  ";
output;
k="Jun 26 2015, 08:38";
output;
run;
data want;
set have;
k1=input(k,anydtdtm21.);
format k1 datetime20.;
run;
ballardw
Super User

@5062917 wrote:

Hi,

I have a dataset where dates are stored as a character in the format, MMM DD YYYY, 00:00, e.g."Jun 26 2015, 08:38" or "Apr 9 2015, 20:15". Is there any way to turn this into a numeric date?

 

 

Thanks in advance 🙂 


Date (day information only) or datetime which includes the time portion? SAS does treat those differently and is important to be precise.

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

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1245 views
  • 0 likes
  • 3 in conversation