BookmarkSubscribeRSS Feed
daisy6
Quartz | Level 8

Hello SAS experts,

 

I use proc tabulate to create some tables and would like to output to excel file. My codes work if I do not use ODS to output to excel, however it does not work when I want it output to excel. The log window did not show any thing wrong, but I can not open xml file.  I use SAS 9.3 version. Here is my code.

 

ODS noresults;
ODS listing close; /*Turn off the standard line printer destination*/
ods tagsets.ExcelXP path="&dir."
file="&client._All.xml"
style=statistical /*Styles to control appearance of output*/;
ods tagsets.ExcelXP options ( sheet_name= "Jurisdiction" autofit_height= 'yes' );


proc tabulate data=alldata;
class state subjects grade attempt_status;
table state, subjects=" "*(attempt_status=" " all="Total"), grade=" "*( N='Count'*f=comma8. rowpctn*f=mypct.) all;
run;

ods _all_ close;
ODS listing;

 

there are 54 states and 5 subjects. 

Thanks for any suggestion.

 

5 REPLIES 5
Reeza
Super User

Does a different ODS destination work, say ODS PDF?

 

Also, what does this mean?

The log window did not show any thing wrong, but I can not open xml file

 

Do you get an error of any kind? 

daisy6
Quartz | Level 8

Thanks for the reply Reeza,

The log window did not have any error sign and it seems it is ok for the code. However, it shows something wrong when I open the XML file. I attached the capture here. I need xml file to reload the output data to SAS, so the PDF output is not my choice. 

Reeza
Super User

The PDF is to test that you're getting any output and there isn't something else isn't wrong. I'm not suggesting you change your requirements, it's a debugging step. 

 


@daisy6 wrote:

Thanks for the reply Reeza,

The log window did not have any error sign and it seems it is ok for the code. However, it shows something wrong when I open the XML file. I attached the capture here. I need xml file to reload the output data to SAS, so the PDF output is not my choice. 


 

ballardw
Super User

Change the ODS NORESULTS; to ODS RESULTS;

NORESULTS tells SAS not to create any ODS output.

daisy6
Quartz | Level 8

Hi SAS guys,

I upgrade my version to 9.4. I don't have that problem any more. Thanks for taking care of it.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

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
  • 1207 views
  • 2 likes
  • 3 in conversation