Dear All,
Just facing a terrible issue when I try to reading from an simple external Excel file, and found there is Warning(figure1) and the problomatic result(figure2).
The sas session is EUC-CN, I am hunting for the solution, please let me know if you have, and I would be highly appreciated.
SAS CODE:
filename x "D:\sas code\encodingIssue\test.xlsx" encoding="utf-8";
proc import datafile=x out=test dbms=xlsx replace;getnames=yes;run;
I suggest you try the XLSX and EXCEL LIBNAMEs and see what your spreadsheet looks like in VIEWTABLE:
libname x XLSX "D:\sas code\encodingIssue\test.xlsx" encoding="utf-8";
libname x EXCEL "D:\sas code\encodingIssue\test.xlsx" encoding="utf-8";
See if UTF-16 helps.
Note: search this forum for Excel and Import data problems.
If you are likely to have more than one file with the same data structure in the long run saving XLSX to a CSV format and reading that with a data step is much more consistent.
Did you try without the ENCODING option? If not please try without that.
You need using SAS (Unicode Support) to run your code.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.