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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.