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;
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!
Register now
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.