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