The SAS Output Delivery System and reporting techniques

ODS Proc Tabulate Level variable style

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

ODS Proc Tabulate Level variable style

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


Accepted Solutions
Solution
‎12-13-2017 02:35 PM
SAS Super FREQ
Posts: 8,961

Re: ODS Proc Tabulate Level variable style

[ Edited ]
Posted in reply to DataGuy99

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


All Replies
Solution
‎12-13-2017 02:35 PM
SAS Super FREQ
Posts: 8,961

Re: ODS Proc Tabulate Level variable style

[ Edited ]
Posted in reply to DataGuy99

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;

 

New Contributor
Posts: 2

Re: ODS Proc Tabulate Level variable style

Posted in reply to Cynthia_sas

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!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 180 views
  • 0 likes
  • 2 in conversation