Hi,
I have a dataset which has admissiondate: 11APR20:23:49:00 (numeric)
Another dateset which has admissiondate: 2020-04-11 23:49:00 ( character)
I want to merge these two datasets.
Can you help me in this? to change character to numeric and change the formats?
thank you in advance.
Hi @Smitha9
You should first convert the character date in dataset2 into a valid sas datetime (numeric).
To do that you can do this;
data dataset2_bis; set dataset2; date2 = input ("2020-04-11 23:49:00",anydtdtm.); format date2 datetime20.; run;
Best,
View solution in original post
SAS provides an informat that can read this datetime value:
data test; instring = "2020-04-11 23:49:00"; dt = input(instring,e8601dt19.); format dt datetime19.; run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Save the date!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.