Help using Base SAS procedures

How to UNBOLD in proc report using escapechar??

Occasional Contributor
Posts: 8

How to UNBOLD in proc report using escapechar??

How do I unbold the headers in proc report using sasdocprinter. I would also like to conditionally highlight cells gray using sasdocprinter. Let's say I want the number 50 to be highlighted in the column panel. How would I do this?  My escapechar is "^" but I am not sure where to place the unbolding and conditional formatting in order to work.


Thank you for all the help!


Currently I have the following:



proc report data = nowindows headline headskip missing center

style(report)=[cellspacing=2 borderwidth=2 bordercolor=black]

style(header) = { font_face = 'Times New Roman' font_size = 10pt just = center cellheight=.52in}




style(column) = {font_face = 'Times New Roman' font_size = 10pt just = center /*asis = on*/ cellheight=.2in};

column panel n min max mean median std stderr cv pvaluen ;

define panel / display /*order*//*group*/ ' / /Panel' center style=[cellwidth=12mm /*cellheight=.2in*/];

define n / display ' / /N' center style=[cellwidth=10mm /*cellheight=.2in*/];

define min / display format = 12.1 ' / Min/Response' center style=[cellwidth=18mm /*cellheight=.2in*/];

define max / display format = 12.1 ' / Max/Response' center style=[cellwidth=18mm /*cellheight=.2in*/];

define mean / display format = 12.1 ' / Mean/Response' center style=[cellwidth=18mm /*cellheight=.2in*/];

define median / display format = 12.1 ' / Median/Response' center style=[cellwidth=18mm /*cellheight=.2in*/];

define std / display format = 12.3 ' / /Std. Dev' center style=[cellwidth=16mm /*cellheight=.2in*/] flow ;

define stderr / display format = 12.3 ' / /Std. Err' center style=[cellwidth=15mm /*cellheight=.2in*/] ;

/*Don't multiply cv by 100 in SAS, it will be formatted here*/

define cv / display format = percent8.1 ' / /%CV' center style=[cellwidth=15mm /*cellheight=.2in*/];

define value/ display format = 12.3 'P-Value for/Normality/Test' center style=[cellwidth=20mm /*cellheight=.2in*/];

compute value;

if value<=0.001;

call define (_10_, "style", "style=[background=ltgray]");





Super User
Posts: 10,501

Re: How to UNBOLD in proc report using escapechar??

The style element Fontweight can take the following options:


where weight is any of the following:








in any place you are specifying any style element. Not all fonts and destinations support all of the weights but Medium usually works.
Highlighting based on a specific value, sometimes refered to as Traffic lighting from green/yellow/red values, could be done in a compute block or by having a custom format indicate color values and use the format for the background/text/ whatever style element .you want to affect.
Here's an example from the online documentation:
proc format;
value proffmt low-<0='red'

proc report data=sashelp.prdsale;
column country predict actual diff;
define country /group;
define diff /'Difference' computed format=dollar12.2 

compute diff;
diff = predict.sum - actual.sum;


Ask a Question
Discussion stats
  • 1 reply
  • 1 like
  • 2 in conversation