BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
chimanbj
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

6 REPLIES 6
ballardw
Super User

Try Sheet_interval = "Proc"

Reeza
Super User

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;

 

 

chimanbj
Obsidian | Level 7

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...

Reeza
Super User

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.

Reeza
Super User

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;
chimanbj
Obsidian | Level 7

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

 

Thanks so much!!!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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