Hi all,
I have data like below:
data data;
input date $20.;
cards;
2019-11-16
2020-04-09T09:40
2020-04-09T13:30
2020-04-10T11:05
2020-05-07T11:00
2020-05-07T11:08
2020-05-08T11:05
2020-06-04T10:05
2020-06-04T11:22
2020-06-05
2020-07-02T10:41
2020-07-02T10:50
;
run;
I would like to change those dates to numeric format of datetime19. and if missing time then I want to show 00:00:00. Can anyone suggest which format can use here?
I am using anydtdtm. but it's not wokring.
Thanks,
Adithya
data data;
input date b8601dt.;
format date datetime16.;
cards;
2019-11-16
2020-04-09T09:40
2020-04-09T13:30
2020-04-10T11:05
2020-05-07T11:00
2020-05-07T11:08
2020-05-08T11:05
2020-06-04T10:05
2020-06-04T11:22
2020-06-05
2020-07-02T10:41
2020-07-02T10:50
;
run;
data data;
input date b8601dt.;
format date datetime16.;
cards;
2019-11-16
2020-04-09T09:40
2020-04-09T13:30
2020-04-10T11:05
2020-05-07T11:00
2020-05-07T11:08
2020-05-08T11:05
2020-06-04T10:05
2020-06-04T11:22
2020-06-05
2020-07-02T10:41
2020-07-02T10:50
;
run;
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 save with the early bird rate—just $795!
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.