Help using Base SAS procedures

Why my tagsets.excelXP can't product multiple sheets in one file?

Reply
N/A
Posts: 1

Why my tagsets.excelXP can't product multiple sheets in one file?

I'm using the code that the online help provided. Just modify the output file path and name.
I have two proc tabulate and supposed to generate two sheets in one workbook. Instead, it always generate two separate workbook with name aedata and aedata1.
I'm using Macbook pro Bootcamp installing Window7-64bit. However my SAS version is 9.2 (32bit).
Can anybody find out what is the problem?
Thanks a lot!

The code is as following:


options center;
title; footnote;
ods listing close;
ods tagsets.ExcelXP path=' ' file='aedata.xml' style=default;

proc tabulate data=sashelp.shoes;
class region;
var sales;
table region, sales='Sales'
*format=dollar20.0*sum='';
run;

proc tabulate data=sashelp.retail;
class year;
var sales;
table year='', sales='Sales (in M$)' *
format=dollar20.0 * sum=''/box='Year';
run;

ods tagsets.ExcelXP close;
Trusted Advisor
Posts: 1,247

Re: Why my tagsets.excelXP can't product multiple sheets in one file?

Hi there,

Your code is almost there... some minor option to get the sheet name and statements that you need to add to get it to produce what you were hoping...

options center;
title; footnote;
ods listing close;
ods tagsets.ExcelXP path=' ' file='aedata.xml' style=default options(sheet_Name="Shoes");

proc tabulate data=sashelp.shoes;
class region;
var sales;
table region, sales='Sales'
*format=dollar20.0*sum='';
run;

ods tagsets.ExcelXP options(sheet_Name="Retail");
proc tabulate data=sashelp.retail;
class year;
var sales;
table year='', sales='Sales (in M$)' *
format=dollar20.0 * sum=''/box='Year';
run;

ods tagsets.ExcelXP close;

I hope this helps.

Cheers,
Michelle
Super User
Posts: 9,673

Re: Why my tagsets.excelXP can't product multiple sheets in one file?

[pre]
options center;
title; footnote;
ods listing close;
ods tagsets.ExcelXP file='c:\aedata.xls' style=default options(sheet_interval='proc');

proc tabulate data=sashelp.shoes;
class region;
var sales;
table region, sales='Sales'
*format=dollar20.0*sum='';
run;

proc tabulate data=sashelp.retail;
class year;
var sales;
table year='', sales='Sales (in M$)' *
format=dollar20.0 * sum=''/box='Year';
run;

ods tagsets.ExcelXP close;
ods listing;
[/pre]


Ksharp
Ask a Question
Discussion stats
  • 2 replies
  • 122 views
  • 0 likes
  • 3 in conversation