The SAS Output Delivery System and reporting techniques

Multiple Reports in a single tab, repeated in multiple tabs

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

Multiple Reports in a single tab, repeated in multiple tabs

I'm doing something that I was hoping would be straightforward, but I'm finding it difficult to get to the "right" answer.  I have a report that I'm creating for a hospital system.  The report consists of 4 separate proc report statements.  I am able to put them all on one tab for a single facility.  However, when I try to have each set of 4 reports into separate tabs of the same workbook, I can't figure out which option I need to use.  My current workaround is to have each tab written out as separate worksheets.  This requires me to put it back together manually, which I would like to avoid. 

 

The tagset statement I"m using is:

ods tagsets.ExcelXP file="&datadir\&hosp..xml"
                    style = printer
                    options(embedded_titles='yes'
                            sheet_interval='none'
                            skip_space='0,0,0,1,1'
                            sheet_name="&hospname"
                            /*doc='help'*/)
;

 

I'm open to all suggestions.


Accepted Solutions
Solution
‎03-31-2016 04:08 PM
Super User
Posts: 17,837

Re: Multiple Reports in a single tab, repeated in multiple tabs

Sheet_name works fine for me.

 

ods tagsets.excelxp file='C:\_localdata\sample.xml' options(sheet_interval='none' sheet_name='Test1') style=meadow;

proc freq data=sashelp.class;
table age;
table sex;
run;

ods tagsets.excelxp options(sheet_interval='none' sheet_name='Test2');

proc means data=sashelp.class;
run;

ods tagsets.excelxp close;

View solution in original post


All Replies
Super User
Posts: 10,500

Re: Multiple Reports in a single tab, repeated in multiple tabs

Try Sheet_interval = "Proc"

Super User
Posts: 17,837

Re: Multiple Reports in a single tab, repeated in multiple tabs

You can change control the breaks with options and sheet_interval.

 

ods tagsets.excelxp file='C:\_localdata\sample.xml' options(sheet_interval='none') style=meadow;

proc freq data=sashelp.class;
table age;
table sex;
run;

ods tagsets.excelxp options(sheet_interval='none' sheet_label='Test');

proc means data=sashelp.class;
run;

ods tagsets.excelxp close;

 

 

Contributor
Posts: 25

Re: Multiple Reports in a single tab, repeated in multiple tabs

Thanks for your reply.  This gave me interesting results.  Indeed, two tabs were created, but the tabs were labeled "Job 1 - Freq" and "Test 2 - Means"

 

I'm not sure where SAS is getting those names...

Super User
Posts: 17,837

Re: Multiple Reports in a single tab, repeated in multiple tabs

There are tagsets options (Sheet_name, Sheet_label) to control the excel tab names...I didn't attempt to change them as that was not your question.

Solution
‎03-31-2016 04:08 PM
Super User
Posts: 17,837

Re: Multiple Reports in a single tab, repeated in multiple tabs

Sheet_name works fine for me.

 

ods tagsets.excelxp file='C:\_localdata\sample.xml' options(sheet_interval='none' sheet_name='Test1') style=meadow;

proc freq data=sashelp.class;
table age;
table sex;
run;

ods tagsets.excelxp options(sheet_interval='none' sheet_name='Test2');

proc means data=sashelp.class;
run;

ods tagsets.excelxp close;
Contributor
Posts: 25

Re: Multiple Reports in a single tab, repeated in multiple tabs

The sheet_interval along with the sheet_name is what makes it work.

 

Thanks so much!!!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 496 views
  • 0 likes
  • 3 in conversation