Hi, guys!
I've connect SAS to SQL server and tried to write data to the server. But the Thai characters don't appear as I expected. They appear as "?".
More information:
The sqlserver running on windows.
SAS running on unix.
And the unicode of SAS session is UTF8.
How I connected SAS to SQL server
libname sslib sqlsvr noprompt="DRIVER=SAS ACCESS to MS SQL Server;
UID=my UID ;PWD=my Password;
HOST=my Host ;PORT=my Port ; db= my Database" schema="dbo";
the data
If I create new table in SQL server from the data
proc sql;
create table sslib.test_temp_output(encoding='utf8') as
select *
from work.temp_tbl(encoding='utf8');
run;
How a new table looks like:
I've tried proc append but the results stay the same.
data _null_;
set temp_tbl(encoding='any');
put string= $quote. +1 string $hex8.;
run;
proc append base=sslib.test_table data=temp_tbl(encoding='utf8') ;
run;
or
data _null_;
set temp_tbl(encoding='any');
put string= $quote. +1 string $hex8.;
run;
proc append base=sslib.test_table data=temp_tbl(encoding='any') ;
run;
Hi @Mayt
Have a look at this paper Multilingual Computing_with SAS 9.4
It looks like you would need to declare your SqlServer Tables with nchar/nvchar columns in order to display utf-8 data values.
Hope this helps,
Ahmed
Hi @Mayt
Have a look at this paper Multilingual Computing_with SAS 9.4
It looks like you would need to declare your SqlServer Tables with nchar/nvchar columns in order to display utf-8 data values.
Hope this helps,
Ahmed
Can we do it in sas studio?
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.