I am unable to read chinese characters from my source file. I will not be sharing the source file coz its has customer details.
I have used the below code for importing.
libname sample xlsx "C:\MBR\property.xlsx";
data Sheetnames;
set sashelp.vtable;
where libname = 'SAMPLE';
run;
libname SAMPLE clear;
proc sql ;
select count(*)
into :NObs
from Sheetnames;
select compress(memname,'$')
into :Name1-:Name%left(&NObs)
from Sheetnames;
select compress(memname,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','K') AS CNAME
into :data1-:data%left(&nobs)
FROM Sheetnames;
quit;
%macro import;
%do i=1 %to &NObs;
proc import datafile="C:\MBR\property.xlsx "
out= &&data&i
dbms=xlsx replace;
sheet="&&name&i";
getnames=no;
datarow=6;
run;
%end;
%mend;
%import;
It would be very helpful if someone has the solution.
What is your SAS encoding ? if it was UTF-8 or EUN_CN ,should be OK.
proc options option=encoding value; run;
An workaround way is save your excel as a CSV file .
and import it again.
filename x 'c:\property.xlsx ' encoding='utf-8';
proc import ........
There are many VBS in internet to convert excel to csv , google it you will find ( Excel2Csv.bat ) .
And could you change your sas encoding as euc-cn
Also try these options.
libname x xlsx 'c:\temp\x.xlsx' inencoding='utf-8' outencoding='utf-8';
I got this error in the log after running the below code that was shared yesterday.
24 libname x xlsx 'C:\MBR\property.xlsx' inencoding='utf-8' outencoding='utf-8';
_______
278
WARNING 278-63: The option INENCODING is not implemented in the XLSX engine.
NOTE: Libref X was successfully assigned as follows:
Engine: XLSX
Physical Name: C:\MBR\property.xlsx
WARNING 278-63: The option OUTENCODING is not implemented in the XLSX engine.
Can anyone help on this please.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.