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

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!

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.

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