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 🙂
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;
@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.
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!
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.
Ready to level-up your skills? Choose your own adventure.