BookmarkSubscribeRSS Feed
boureg
Calcite | Level 5

I want to extract data from a Microsoft Access database table and get, when opening the table in SAS Enterprise Guide, the error message “... unable to transcode data to/from UCS-2 encoding”.

 

The SAS Enterprise Guide, version 7.15 HF3 (7.100.5.6132) (64-Bit), runs on Linux, the Microsoft Access database is connected with LIBNAME PCFILES and is password protected. The libname statement works well and after processing the libname the tables of the Microsoft Access database are visible in the SAS Enterprise Guide (below left, server tab).

 

The reason for the error is the usage of three points (“…”) in a row in one of the columns of the tables in the Microsoft Access database, which Microsoft Access converts automatically to a single sign, called horizontal ellipsis. If the column is removed from the corresponding table before processing in SAS Enterprise Guide, the error message does not appear and the data can be extracted. But it is desired to take all the columns from the table in MS Access. MS Access runs on Windows Terminal Sever (thin client).

 

Code for libname

LIBNAME <name> PCFILES

SERVER="<ip address>"

SERVERUSER="<user key>"

SERVERPASS="<user pw>"

PATH="<path in windows>\<database name>.accdb"

PASS="<database pw>";

 

To change the encoding of SAS (LATIN 9 to UTF-8) is not an option. To use Proc Import instead of LIBNAME PCFILES shows the same error message.

 

Does anyone have a good idea for another option to solve this problem?

2 REPLIES 2
CaseySmith
SAS Employee

The reason you are getting the transcoding error is because you are trying to read a character that is not recognized in your current SAS session encoding.  I would normally recommend changing your SAS session encoding to UTF-8, but if that is not an option, the only other thing I can think to try is to ignore the transcoding error via the NORSASIOTRANSERROR system option...

https://go.documentation.sas.com/?docsetId=nlsref&docsetTarget=p09yh96xgvdzhjn1gimcw1d7vy1c.htm&docs...

 

... or try the outencoding option (on a libname statement) to copy the data to a library with an encoding that your current session encoding supports (ex. LATIN9 in your case):

https://go.documentation.sas.com/?docsetId=nlsref&docsetTarget=n02q3gv9mfdwnmn1ca9kqa3gbayl.htm&docs...

(ex. https://communities.sas.com/t5/General-SAS-Programming/Transcoding-problem/td-p/390028)

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

boureg
Calcite | Level 5

Many thanks for your answer. However, the option outencoding does not work with libname + pcfiles statement. Since, the NORSASIOTRANSERROR option is valid for the whole SAS environment, I cannot use this option.

sas-innovate-2024.png

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 Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2707 views
  • 0 likes
  • 2 in conversation