Desktop productivity for business analysts and programmers

Failed to transcode data from UTF-16LE to wlatin1

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

Failed to transcode data from UTF-16LE to wlatin1

 

Dear Sir / Madam,

 

I installed SAS 9.4, but can not import data from excel. there are 2 problems.

1) Failed to transcode data from UTF-16LE to wlatin1

I tried to follow the previous problems in these articles, but can find solutions. 

https://communities.sas.com/t5/Base-SAS-Programming/Failed-to-transcode-data-from-UTF-16LE-to-wlatin...

https://communities.sas.com/t5/SAS-Enterprise-Guide/Transcode-data-from-utf16le-to-wlatin1-issue/td-...

 

2) Missing microsoft office component.

And I tried to save the excel in a xlsx with the only data sheet in it, but it shows missing microsoft office component.

 

6f0360c6d901b109cffaccc84e699a2.png

 

 

921aeea7c65b37a635331cda40e312e.png

 


Accepted Solutions
Solution
‎12-02-2017 12:07 AM
Occasional Contributor
Posts: 10

Re: Failed to transcode data from UTF-16LE to wlatin1

Posted in reply to JuanS_OCS

Finally, I solve this problem with this:

 

1.  Close EG

2.  Go to D:\Program Files\SAS Home\SAS Foundation\ 9.4

3.  Open the sasv9.cfg file in notepad

4.  Comment out this line:

/*-config "D:\Program Files\SAS Home\SASFoundation\9.4\nls\en\sasv9.cfg" */

5.  Add this line

-config "D:\Program Files\SAS Home\SASFoundation\9.4\nls\u8\sasv9.cfg"

6.  Save the file.

 

Open EG and test.

I thought it might because I didn't choose utf-8 as default, thank you.

 

 

View solution in original post


All Replies
Trusted Advisor
Posts: 1,718

Re: Failed to transcode data from UTF-16LE to wlatin1

Posted in reply to Daisyliang

Hello @Daisyliang,

 

what maintenance of SAS 9.4 do you have installed? Besides, I think you should check if your EG and Office bit-ness are 32-bit or 64-bit. Both must be at the same level. Also please check, as the second window suggest, if you have all the ACE components installed and on the proper version.

 

http://support.sas.com/resources/papers/proceedings16/10863-2016.pdf

https://communities.sas.com/t5/Administration-and-Deployment/64-bit-Microsoft-ACE-drive-supported-on...

 

Also, if your Office document it is saved with UTF-8/UNICODE/Double-byte characters, and your SAS Session is on single byte (wlatin) it won't be able to translate/transcode. You would need to have a workspace server session on UTF-8/UNICODE level.

 

I also have seen when an Excel file,s aved on certain ways, it contains on the first lines a "Korean" blah-blah string, if removed, it works. Of course, that is not something you can do for every Excel file, hence, to apply the latest hotfixes or maintenance, it is very recommended.

 

If nothing of this works, I would recommend you to contact SAS Technical Support.

Occasional Contributor
Posts: 10

Re: Failed to transcode data from UTF-16LE to wlatin1

Posted in reply to JuanS_OCS

Thx for your kindly reply, for question 2) I find out that it's because the version of my office is 32bit, and now I reinstalled a 64bit version, the problem solved.

 

But for question 1, I still don't have any idea of what to do, because I'm a new learner of SAS, no experiences in coding. The SAS 9.4 is the newest I suppose, becasue I just installed and uploaded it. Is it because when I installed it, I didn't choose utf-8 as a default option? should I just reinstall it with utf-8?

 

Regards.

Solution
‎12-02-2017 12:07 AM
Occasional Contributor
Posts: 10

Re: Failed to transcode data from UTF-16LE to wlatin1

Posted in reply to JuanS_OCS

Finally, I solve this problem with this:

 

1.  Close EG

2.  Go to D:\Program Files\SAS Home\SAS Foundation\ 9.4

3.  Open the sasv9.cfg file in notepad

4.  Comment out this line:

/*-config "D:\Program Files\SAS Home\SASFoundation\9.4\nls\en\sasv9.cfg" */

5.  Add this line

-config "D:\Program Files\SAS Home\SASFoundation\9.4\nls\u8\sasv9.cfg"

6.  Save the file.

 

Open EG and test.

I thought it might because I didn't choose utf-8 as default, thank you.

 

 

Super User
Posts: 9,611

Re: Failed to transcode data from UTF-16LE to wlatin1

Posted in reply to Daisyliang

Make sure SAS runs with correct encoding (as @JuanS_OCS already recommended)

To avoid hassles with MS-installed (or not-installed) modules, copy your files to the SAS server and run a straight proc import there. SAS 9.4 can read/write xlsx directly on any platform.

Best option: use a sensible, text-based file format for data transfers between applications. Save to csv from Excel, and import that, or read with a custom data step. Similarly, write to csv from SAS, and use that in Excel.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 547 views
  • 1 like
  • 3 in conversation