BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
elbart
Fluorite | Level 6

Hello everyone!

 

I am experiencing the same problem as a person in this theme: (https://communities.sas.com/t5/Base-SAS-Programming/SAP-HANA/m-p/277026/highlight/true#M55574)

When I try to connect to SAP Hana database with ODBC connector using connection string in SAS DI, it throws an error:

 

ERROR: CLI cursor fetch error: [SAP AG][LIBODBCHDB DLL][HDBODBC] General error;-10427 Conversion of parameter/column (3) from data type NVARCHAR to ASCII failed

 

This error is definitely the Unicode one, because I can’t import some columns with Unicode symbols while others are well imported.

 

When I connect to SAP Hana with Metadata Server, it imports all needed tables, but throws an error which is attached.

Could somebody explain step by step approach to solve this problem?

 

Many thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
elbart
Fluorite | Level 6

I solved this problem.

I have changed encoding in sasv9.cfg files in Workspace Server directory and SASApp server directory.

 

Thanks for help! 

View solution in original post

11 REPLIES 11
ChrisNZ
Tourmaline | Level 20

Moved question to Data Management board.

 

This is an ODBC error message. Are you sure this driver supports unicode data?

elbart
Fluorite | Level 6

ChrisNZ, Yes I am quite sure that this driver supports Unicode transfer. 

(here is the topic on SAP forum https://archive.sap.com/discussions/thread/3882688).

The problem is that SAS can't convert Unicode symbols - looks more like that, to my mind. 

SASKiwi
PROC Star

What is your SAS encoding setting? Maybe it is not set up for Unicode. Run proc options and tell us what the ENCODING option is set to. 

elbart
Fluorite | Level 6

SASKiwi, My Encoding session is WCYRILIC.

I tried to change "C:\Program Files\SASHome\SASFoundation\9.3\sasv9.cfg" file to utf-8, but after relaunching SAS DI it showed wcyrillic again.

Could you tell how to change it correctly?

ChrisNZ
Tourmaline | Level 20
What is the encoding of the sas session (I am not even sure there is a choice in DI)?
Can you use SQL pass through to ensure variables are sent as SQL_WLONGCHAR?
Can you use a different odbc client to ensure odbc is out of the equation?
elbart
Fluorite | Level 6

My Encoding session is WCYRILIC.

I am using pass through facility (with coding) to import columns from HANA, but how to define that variables are send in SQL_WLONGCHAR? 

 

I have only one ODBC driver that fit my needs for Hana connection.

No idea what else can I use instead. 

SASKiwi
PROC Star

I suspect you might find some answers to your problems in the NLS Guide:

 

http://support.sas.com/documentation/cdl/en/nlsref/69741/HTML/default/viewer.htm#nlsrefwhatsnew94.ht...

 

You may need to check the LOCALE option as well as ENCODING.

elbart
Fluorite | Level 6

SASKiwi, I tried to change encoding to UTF-8 in "C:\Program Files\SASHome\SASFoundation\9.3\sasv9.cfg" file with no effect for SAS Data Integration Studio. With proc options option=encoding; run; it showed WCYRILLIC again.

This article http://support.sas.com/resources/papers/Multilingual_Computing_with_SAS_94.pdf advises to make changes in Java font configuration files for SAS DIS.

What kind of changes should I make there (in this "C:\Program Files\Java\jre6\lib\fontconfig.properties.src" file as I understand)? I tried to find wcyrillic font anywhere there, but found nothing.

ChrisNZ
Tourmaline | Level 20

>My Encoding session is WCYRILIC.

You may have to switch to UTF encoding. Read the documentation that @SASKiwi pointed to.

 

>I am using pass through facility (with coding) to import columns from HANA, but how to define that variables are send in SQL_WLONGCHAR

I was hoping as function such as CE_CALC would help, but it won't return type SQL_WLONGCHAR. There may be other functions to change type, or some of the supported types may not break Unicode. I don't have SAP here so can't test.

 

>I have only one ODBC driver that fit my needs for Hana connection.No idea what else can I use instead. 

Can you use a different odbc client to ensure odbc is out of the equation?

Client, not driver.

 

 

elbart
Fluorite | Level 6

I solved this problem.

I have changed encoding in sasv9.cfg files in Workspace Server directory and SASApp server directory.

 

Thanks for help! 

SASKiwi
PROC Star

Great to hear!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 4417 views
  • 0 likes
  • 3 in conversation