BookmarkSubscribeRSS Feed
Harry
Obsidian | Level 7
I’m having difficulty creating the 1st summary sheet with a specific name, and then automatically naming subsequent sheets with the BY variable value. If I don’t include the summary sheet, the BY sheets are as desired, F & M, but it seems if I’ve specified a sheet_name value once, that’s the one that’s used for a subsequent sheets. Or, if I specify a blank sheet_name in the 2nd ODS statement, the subsequent sheets are numbered consecutively, 2 & 3 and are not named with the BY variable value.

How do I get three sheets, first one “All”, second “F”, third “M” ? I downloaded the latest tagset, no difference.

NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.94, 09/09/12).

title 'Want 1st sheet All, rest to be bygroups';

ods listing close;
ods tagsets.excelxp
file = "c:\temp\tagsets_sheetname.xls"
style = seaside
options ( embedded_titles = 'Yes'
sheet_name = 'All'
sheet_interval = 'bygroup'
sheet_label = ' '
suppress_bylines = 'yes'
)
;

proc print data = sashelp.class noobs;
run;

ods tagsets.excelxp
options ( sheet_interval = 'bygroup'
sheet_label = ' '
sheet_name = ' '
suppress_bylines = 'yes'
)
;

proc sort data = sashelp.class
out = class;
by sex;
run;

proc print data = class noobs;
by sex;
run;

ods tagsets.excelxp close;
ods listing;
3 REPLIES 3
data_null__
Jade | Level 19
See if the modification works for you

[pre]
ods tagsets.excelxp
options ( sheet_interval = 'bygroup'
sheet_label = ' '
sheet_name = 'none'

suppress_bylines = 'yes'
)
;
[/pre]
Peter_C
Rhodochrosite | Level 12
That is almost perfect!
It shows the title line just once for each PROC so no title shows after the first by-group on the second PROC PRINT.
Is that because I'm working with excelXP v1.94?
Are later releases able to surface titles for every by-group?

peterC

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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