Label variable with special character

This post was kindly contributed by SAS & Statistics - go there to comment and to read the full post.

Create delta in the report and label:

ods escapechar=’^’;
ods rtf file=’temp.rtf’; *** Can be HTML or PDF too;

proc report data=sashelp.class nowd ps=40;
&nbsp &nbsp &nbsp col age new;
&nbsp &nbsp &nbsp define new / format=$30. ;
/* for the RTF */
&nbsp &nbsp &nbsp compute new/char ;
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp new=’^S={font_face=symbol} D’;
&nbsp &nbsp &nbsp endcomp;
/* for the listing */
&nbsp &nbsp &nbsp label age=”my label” ‘F0’X ;
run;

ods rtf close;

Create superscript:

Get superscripts for 0, 1, 2, and 3 in printed SAS output by using the extended characters specified in hexadecimal. The following example shows the superscripts for 0, 1, 2, and 3 using ‘b0’x, ‘b9’x, ‘b2’x ‘b3’x respectively:

data _null_;
&nbsp &nbsp &nbsp file print;
&nbsp &nbsp &nbsp put ‘This is a superscript zero’ ‘b0’x;
&nbsp &nbsp &nbsp put ‘This is a superscript one’ ‘b9’x;
&nbsp &nbsp &nbsp put ‘This is a superscript two’ ‘b2’x;
&nbsp &nbsp &nbsp put ‘This is a superscript three’ ‘b3’x;
run;

proc print label data=sashelp.class;
&nbsp &nbsp &nbsp label age=age’b2’x;
run;

This post was kindly contributed by SAS & Statistics - go there to comment and to read the full post.