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.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.