SAS 9.4 using Proc Tabulate and ODS PDF output. How do I change the style (font, size, color, etc.) of the "level" variable label that prints just above the table that is created by a "by" statement? And a related issue is how to change the content of the label which is currently "level = <value>". Can I eliminate or edit the "level=" part?
Thanks - Tommy
Hi, can you post an example of some code with data or make an example using SASHELP data?
Otherwise it is hard to visualize what you want and are trying to do.
cynthia
Here's a code example that I have which uses SASHELP.SHOES, so you should be able to run the code. Rather than using a style template to alter the normal BYLINE, I tend to use the BY statement and put the BY information in the TITLE because the TITLE statement has the method built in to change color, font, size, etc.
proc sort data=sashelp.shoes out=shoes;
where region in ('United States' 'Canada' 'Western Europe') and
product in ('Boot' 'Slipper' 'Sandal' 'Sport Shoe');
by region product;
run;
proc format;
value $prd 'Boot'='lightgreen'
'Sandal'='lightyellow'
'Sport Shoe' = 'lightblue'
'Slipper' = 'peachpuff';
run;
title; footnote;
options nobyline;
ods pdf file='c:\temp\byvar_in_title.pdf';
proc tabulate data=shoes f=dollar15.2;
title c=purple f="Courier New" h=14pt bold 'For #byval1';
title2 'Plus other changes';
by region;
class region product / style={font_face="Courier New" color=red background=cxDDDDDD};
classlev product / style={background=$prd.};
var sales returns inventory;
table product all*{style=Header{font_size=10pt}},
sales*(sum mean max) returns*(sum mean) inventory*(sum mean);
keylabel All='Summary';
keyword All / style=Header;
run;
ods pdf close;
options byline;
title; footnote;
Hi, can you post an example of some code with data or make an example using SASHELP data?
Otherwise it is hard to visualize what you want and are trying to do.
cynthia
Here's a code example that I have which uses SASHELP.SHOES, so you should be able to run the code. Rather than using a style template to alter the normal BYLINE, I tend to use the BY statement and put the BY information in the TITLE because the TITLE statement has the method built in to change color, font, size, etc.
proc sort data=sashelp.shoes out=shoes;
where region in ('United States' 'Canada' 'Western Europe') and
product in ('Boot' 'Slipper' 'Sandal' 'Sport Shoe');
by region product;
run;
proc format;
value $prd 'Boot'='lightgreen'
'Sandal'='lightyellow'
'Sport Shoe' = 'lightblue'
'Slipper' = 'peachpuff';
run;
title; footnote;
options nobyline;
ods pdf file='c:\temp\byvar_in_title.pdf';
proc tabulate data=shoes f=dollar15.2;
title c=purple f="Courier New" h=14pt bold 'For #byval1';
title2 'Plus other changes';
by region;
class region product / style={font_face="Courier New" color=red background=cxDDDDDD};
classlev product / style={background=$prd.};
var sales returns inventory;
table product all*{style=Header{font_size=10pt}},
sales*(sum mean max) returns*(sum mean) inventory*(sum mean);
keylabel All='Summary';
keyword All / style=Header;
run;
ods pdf close;
options byline;
title; footnote;
So if I want to modify the byline style I need to edit the style template that I am using for the pdf output. I took a look at proc template and the byline has its own section so problem solved. Thank you very much!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.