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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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;

 

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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;

 

DataGuy99
Calcite | Level 5

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!

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
  • 2 replies
  • 787 views
  • 0 likes
  • 2 in conversation