Sample 49590: Insert special symbols as a table value in ODS MARKUP destinations
There are often symbols such as Greek letters or mathematical symbols needed outside of typical text to enhance the meaning of SAS® output. The UNICODE inline style function available beginning in SAS® 9.2 provides a direct way to insert these characters.
The sample code on the Full Code tab illustrates the insertion of a Greek letter, an arrow, and a check mark symbol using PROC REPORT routed to ODS HTML. These symbols can be assigned in a variable value or with a format.
Wikipedia is a good resource for a list of Unicode values.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The inline style function UNICODE enables you to display any Unicode character in the ODS HTML, RTF, and PRINTER (PCL/PDF/PS) destinations. The sample code below displays the Greek letter alpha, an arrow, and a check mark.
ods escapechar="^";
ods html file='symbol.html' style=sasweb;
/* Example 1: Variable value */
data a;
text='display special symbols';
alpha='^{unicode 0251}';
arrow='^{unicode 27A9}';
check = '^{unicode 2713}';
run;
title 'Insert special symbols as variable values';
proc report data=a nowd;
run;
/* Example 2: Format */
data b;
text='display special symbols';
symbol=1; output;
symbol=2; output;
symbol=3; output;
run;
proc format;
value sym
1 = '^{unicode 0251}'
2 = '^{unicode 27A9}'
3 = '^{unicode 2713}'
;
run;
title 'Insert special symbols with a format';
proc report data=b nowd;
format symbol sym.;
run;
ods html close;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
There are often symbols such as Greek letters or mathematical symbols needed outside of typical text to enhance the meaning of SAS® output. The UNICODE inline style function available beginning in SAS® 9.2 provides a direct way to insert these characters.
Date Modified: | 2013-04-30 14:59:08 |
Date Created: | 2013-04-04 11:19:54 |
Operating System and Release Information
SAS System | Base SAS | Solaris for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
Windows Vista for x64 | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
z/OS | 9.2 TS1M0 | |