BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hhchenfx
Barite | Level 11

Hi Everyone,

As stated, when I export SAS file to Excel (xlsx), all characters variable become blank.

Any tips, please?

Thank you.

HHCFX

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

5 REPLIES 5
Cynthia_sas
SAS Super FREQ
Hi:
What code are you using? There are several methods to export from SAS to Excel -- LIBNAME engine, PROC EXPORT, ODS EXCEL, ODS CSV, ODS TAGSETS.EXCELXP. Without code it's hard to guess which method you're using. Also, what's your data like? Can you post a sample file?

Cynthia
hhchenfx
Barite | Level 11

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;

 

ballardw
Super User

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.

hhchenfx
Barite | Level 11

Thanks a lot for your suggestion.

HHC

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3536 views
  • 0 likes
  • 4 in conversation