Hi Everyone,
As stated, when I export SAS file to Excel (xlsx), all characters variable become blank.
Any tips, please?
Thank you.
HHCFX
It sounds like your data file contains tags that are xml values and likely have something incomplete or out of order such as table, row or cell end or start markers without the matching start or end.
Normally I would say it is best would be to show the values in the data set for a few rows.
But with this error:
XML error. (Strings) Illegal xml character. Line 1, column 9431.
I don't want to look at thousands of characters posted here. So I suggest looking very closely at your data.
After 500 posts here, the necessity of posting code and example data should be a given.
So I try to export multiple sheet to a Excel file.
I try to export 1 by 1 and download/open the excel file each time the export complete to see what is going on
1 - When it come to the a file, export goes no error. But when I open Excel, the notice show up
"We found a problem with some content in 'file name.xlsx'. Do you want us to try to recover as much as we can? if you trust the source of this workbook, click Yes.
When work book opened, all worksheets character variable are gone. These variable are user name and type of worker (say employee, contractor).
The error on Excel show up is:
Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
Removed Part: /xl/sharedStrings.xml part with XML error. (Strings) Illegal xml character. Line 1, column 9431.
Removed Records: Cell information from /xl/worksheets/sheet1.xml part
Removed Records: Cell information from /xl/worksheets/sheet2.xml part
Removed Records: Cell information from /xl/worksheets/sheet3.xml part
Removed Records: Cell information from /xl/worksheets/sheet4.xml part
Removed Records: Cell information from /xl/worksheets/sheet5.xml part
Removed Records: Cell information from /xl/worksheets/sheet6.xml part
2-When I export only those files I know working (based on the checking process above) all at once, the same issue show up.
The code I use:
PROC EXPORT
data=project_no_id
DBMS=xlsx
outfile="&export_folder_EXCEL./Report_Projection.XLSx"
replace;
sheet="project_no_id";
run;
It sounds like your data file contains tags that are xml values and likely have something incomplete or out of order such as table, row or cell end or start markers without the matching start or end.
Normally I would say it is best would be to show the values in the data set for a few rows.
But with this error:
XML error. (Strings) Illegal xml character. Line 1, column 9431.
I don't want to look at thousands of characters posted here. So I suggest looking very closely at your data.
Thanks a lot for your suggestion.
HHC
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.