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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Submit your idea!
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.