- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What is your SAS encoding ? if it was UTF-8 or EUN_CN ,should be OK.
proc options option=encoding value; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 ........
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There are many VBS in internet to convert excel to csv , google it you will find ( Excel2Csv.bat ) .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
And could you change your sas encoding as euc-cn
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Also try these options.
libname x xlsx 'c:\temp\x.xlsx' inencoding='utf-8' outencoding='utf-8';
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone help on this please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content