How to print below date in SAS and then extract date & time part in different variables from the same date??
22Feb2019 11:44:00 PM
is your datetime variable numeric i.e number of seconds from Jan 1,1960 that is formatted in that fashion or character?
It is numeric, say you are fetching it using datetime() function for the current date & time.
Well I think @Jagadishkatam 's demo does just that. Let us know if you need more
data want;
dt='22Feb2019 11:44:00 PM'dt;
date=datepart(dt);
time=timepart(dt);
format dt datetime20. date date9. time time5.;
run;
is there any format to print the both datetime & time in below format??
datetime:- 22Feb2019 11:44:00 PM
time:- 11:44:00 PM
Yeah thanks a lot (Y)
thats solves my problem 🙂
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.