The SAS Output Delivery System and reporting techniques

about ods tagsets.excelxp proc tubulate

Reply
Frequent Contributor
Posts: 102

about ods tagsets.excelxp proc tubulate

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.

 

Super User
Posts: 23,224

Re: about ods tagsets.excelxp proc tubulate

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? 

Frequent Contributor
Posts: 102

Re: about ods tagsets.excelxp proc tubulate

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. 

Super User
Posts: 23,224

Re: about ods tagsets.excelxp proc tubulate

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. 


 

Highlighted
Super User
Posts: 13,283

Re: about ods tagsets.excelxp proc tubulate

[ Edited ]

Change the ODS NORESULTS; to ODS RESULTS;

NORESULTS tells SAS not to create any ODS output.

Frequent Contributor
Posts: 102

Re: about ods tagsets.excelxp proc tubulate

Hi SAS guys,

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

Ask a Question
Discussion stats
  • 5 replies
  • 366 views
  • 2 likes
  • 3 in conversation