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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.