BookmarkSubscribeRSS Feed
Daniela_P
Obsidian | Level 7

Dear experts,

I'd like to change the default number of the sheets when I use tagsets.excelxp with a proc tabulate and different table instructions inside.

I'd like to avoid the alternative way to create many proc tabulate as many tables I have to do...

Is there any option/code to do it?

Thanks in advance.

Daniela

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Sorry you will need to be clearer in your description, I am not understanding what you mean by "default number" of sheets?  Specify what you are doing with code and required output.

Daniela_P
Obsidian | Level 7

The problem is when I write a lot of table inside the same proc tabulate (within an ods tagsets.excelxp output):

ods tagsets.excelxp path="C:\Tables" file="table1.xml";

ods tagsets.excelxp options (sheet_interval="table");

ods tagsets.excelxp options (sheet_name="table 1");

     proc tabulate data=sashelp.class;

     CLASS age sex height weight;

     TABLE  age,sex*(n=''*F=9.)/rts=40;

     TABLE  height,sex*(n=''*F=9.)/rts=40;

     TABLE  weight,sex*(n=''*F=9.)/rts=40;

     run;

ods tagsets.excelxp options (sheet_name="table 2");

     proc tabulate data=sashelp.class;

     where age=15;

     CLASS age sex height weight;

     TABLE  age,sex*(n=''*F=9.)/rts=40;

     TABLE  height,sex*(n=''*F=9.)/rts=40;

     TABLE  weight,sex*(n=''*F=9.)/rts=40;

     run;

ods _all_ close;

By default sas names the sheets of the first proc: table 1 , table 1 2, table 1 3 and the sheets of the second proc: table 2, table 2 2, table 2 3.

I'd like, instead: table 1.1 , table 1.2, table 1.3 and table 2.1 , table 2.2, table 2.3.

So it should begin from number 1 in the first sheet (instead of writing nothing) and  it should put "." instead of the space between the name and the counter.

Thanks again,

Daniela

Cynthia_sas
SAS Super FREQ

Hi:

  I am not sure you can get ODS to use a '.' instead of a space, but you can use the sheet_name and sheet_label suboptions to have some control over the table. Switching your code to SAS Macro might be one approach. I am not sure whether you can change the tagset template for ExcelXP to alter the way it makes sheet names or not. That would be a question for Tech Support.

cynthia

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 778 views
  • 0 likes
  • 3 in conversation