Symbols such as Greek letters or mathematical symbols are often needed outside of typical text to enhance the meaning of SAS® output. The UNICODE inline style function provides a direct way to insert these characters.
The sample code in the Full Code section shows the insertion of several Greek letters, as well as the ≤ (less than or equal to) symbol using PROC PRINT routed to ODS RTF and ODS PDF. This function can be used with any procedure or the DATA step, which routes output to most ODS MARKUP destinations. The syntax is discussed under Using Unicode Symbols.
The inline style function UNICODE enables any unicode character to be displayed in the ODS HTML, RTF, and PRINTER (PCL/PDF/PS) destinations. The sample code displays the IOTA, ALPHA, MU, and ZETA characters in the titles, and the ≤ symbol in the header text of the variable POP.
ods escapechar="^";
ods rtf file="unicode_symbols.rtf" style=sasdocprinter;
ods pdf file="unicode_symbols.pdf" style=sasdocprinter;
proc print data=sashelp.demographics(obs=20) noobs l;
var region pop;
label pop="TESTING ^{super ^{unicode 2264}}";
title 'Unicode IOTA is ^{unicode 03B9}';
title2 'Unicode ALPHA is ^{unicode alpha}';
title3 'Unicode MU is ^{unicode mu}';
title4 'Unicode ZETA is ^{unicode 0396}';
run;
ods _all_ close;
Output