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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.