Hi Guys,
I have "2018-10-01 00:00:00:00" as char value and I want to convert it into sas datetime value through proc sql .. please help me out.
Thanks,
Arun
please try the anydtdtm format
data have; x='2018-10-01 00:00:00:00'; y=input(x,anydtdtm.); format y datetime20.; run;
View solution in original post
Hello @Arun_shSAS
Will this help?
proc sql; select *,input(char,ymddttm19.) as sas_datetime format=datetime20. from your_input; quit;
This assumes you have a char datetime variable in your input dataset
proc sql;select *,input(my_time,anydtdtm.) as sas_datetime format=datetime20.from temp;quit;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.