I need your help please.
When I write a query results to a SQL Server via library - I get question marks instead of hebrew letters.
I use sqloledb provider, maybe I need to modify my libname statement.
I tried encoding="hebrew" and encoding="utf-8" - no luck.
When I select from other tables that contain hebrew - I see characters OK, it is just when WRITING the data.
Please help
Thank you
Michael
Clarification needed:
1) What OS is the SQL server?
2) What is the SAS environment? (MF / Windows / Unix or linux) and
Is it a local sas or running on a server (SAS Studio as: SAS EG / SAS UE) ?
3) By what Code have you written to the SQL server ?
Please post it using the "running man" icon.
4) Check the sas configuration file used when running the code -
what is the locale and encoding options ?
1) SQL Server is on Windows Server OS (not sure which)
2) I am using a local EG client connected to a SAS Server (probably Unix, not sure)
3) I am using libraries. For SQL Server I use this code:
libname sqllib oledb
datasource = SQLSERVERNAME provider=sqloledb schema='dbo' properties=('initial catalog'=MYDBNAME)
user=user password=password
READBUFF=30000 INSERTBUFF=30000
encoding="utf-8";4) When I look at log - I do see ENCODING=UTF8
I think it has smth. to do with nvarchart data types.
In SQL Server itself (without SAS) if I insert a value with hebrew characters with regular quotations - then I get question marks.
But if i put N'' before quotations - then it is OK.
So, how do I make SAS write to SQL Server with N''?
Thank you!
@mshparber_fnx , I have asked the questions because I think the answer is the hint for how to fix the issue.
I'm sorry but I have never worked with SQL Server.
Is there anyone that you know work with this database, that can help you.
Is there any tool that you can look at a visible Hebrew text in the SQL server
and check what Hebrew - hex value - it is used.
If you post the some couples like 'א' = "##'x, 'ת'="##"x value, I may suggest
a code to translate your local Hebrew to the target Hebrew.
@mshparber_fnx - What is the encoding of your SAS session? Do Hebrew letters display OK in SAS when viewing a SAS dataset - one you are trying to load into SQL Server?
Thanks to @Hagay - the solution is to specify in libname the following code:
It just not working for me, but maybe it's SAS version issue.
CHAR_AS_NCHAR=YES
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.