DATA Step, Macro, Functions and more

data-step label font-size

Regular Contributor
Posts: 196

data-step label font-size

I'm using proc print to print out the information created in reports2.
How do I change the font-size for the labels of title1 and title2?
Thank you.

data reports2;
length title1 $64 title2 $64 url1 $200 url2 $200;
label title1="Updated &date1., 2011" title2="Updated June 17, 2011";
input bu $18. / title1 $64. / url1 $200. / title2 $64. / url2 $200. ;
Posts: 8,743

Re: data-step label font-size

TITLE1 and TITLE2 appear to be variables, as are BU, URL1 and URL2. When you use PROC PRINT, either the variable names or labels are used, depending on procedure options. With PROC PRINT, you must use either the LABEL or the SPLIT= option in order to have your variable labels used.

Then, in order to alter the default font size of the PROC PRINT output, you must:
1) route your output to a destination that supports style changes (such as HTML, RTF or PDF)
2) use the appropriate STYLE(HEADER)= override in your PROC PRINT code
3a) decide whether you want all the headers the same size or
3b) decide whether you want different headers different sizes.

The program below illustrates the 3b approach. If you wanted ALL the headers to be the same size, then your PROC PRINT code would NOT have style overrides on the VAR statements, but would, instead, have style overrides on the PROC PRINT statement itself:
proc print data=sashelp.class label noobs

ods html file='c:\temp\large_labels.html' style=sasweb;

proc print data=sashelp.class(obs=3) split='*' noobs;
var name / style(header)={font_size=18pt vjust=b} ;
var age / style(header)={font_size=10pt vjust=b};
var height weight / style(header)={font_size=24pt vjust=b};
label name = 'Student Name'
age = "Updated on*June 19, 2011";
ods html close;
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation