- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello SAS Colleagues,
I am encountering this error while working on a dataset that earlier imported from a websource:
"Failed to transcode data from utf-8 to utf-16le encoding because it contained characters which are not supported by your SAS session encoding..." (screen-shot attached).
I have already configured my SAS to "u8" version long before importing this data; and it is still the same. Also, I find this message is strange as usually it is reverse (as per my websearch).
Moreover, also noticed: SAS 9.4 is 64-bit while Enterprise Guide is 32-bit. Not sure if this is causing the problem.
It will be great if someone can help me 🙂
Thanks,
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
So, my solution for this error (credit goes to my project leader):
first, to change back my sas configuration to "en" from "u8" that I was using for certain files.
second, assign libname for folders of all "u8" sas files with the option "inencoding=wlatin2".
Hope this will be helpful for someone else like me encountering problems with characters.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
May be it has been discussed here (https://communities.sas.com/t5/SAS-Enterprise-Guide/Encoding-Issue-UTF8-to-UTF-16-le/td-p/380048)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't have access to Enterprise Guide but had I faced the same issue on SAS Studio,I would have done the below mentioned steps.
If you try to add "PUTLOG _ALL_" at the beginning of the DATA/PROC step and scan each line for _ERROR_ and _N_, you may find the first offending line (the value of _N_) where it says _ERROR_=1.
Open the file in the native program (using which the data file was written) or even notepad/vi is a good idea and go to that line and see which character is causing the error.
Please let me know if this was of any help.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sure @Vassilis .
1) You can change the configuration in the config. file that you should see in your C:. A path will be something similar to :
C:/program files/SAS Home/SAS Foundation/9.4/sasv9.cfg
This should open a text file where you can see nls\en\sasv9: change "en" to "u8".
(See for more details: https://documentation.sas.com/?docsetId=dplyml0phy0win&docsetTarget=p61010as31914aa4aa1477100150.htm...)
If you have special characters in excel file; this step should be enough.
2) But if in future you would need to convert this sas dataset again to english version (bz sometimes merging datasets require the same config in all datasets):
Then import with libname where you need to specify inencoding=wlatin1 or wlatin2.
(See for more details: https://documentation.sas.com/?docsetId=nlsref&docsetTarget=n02q3gv9mfdwnmn1ca9kqa3gbayl.htm&docsetV...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
So, my solution for this error (credit goes to my project leader):
first, to change back my sas configuration to "en" from "u8" that I was using for certain files.
second, assign libname for folders of all "u8" sas files with the option "inencoding=wlatin2".
Hope this will be helpful for someone else like me encountering problems with characters.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am facing the same problem while trying to import an excel file to Enterprise Guide. Can you please provide details about the changes you made? I cannot find the way to change SAS configuration or where to insert the "inencoding=wlatin2" option. Thank you in advance.