The SAS Output Delivery System and reporting techniques

Using Unicode in PROC REPORT Pretext

Accepted Solution Solved
Reply
Regular Contributor
Posts: 220
Accepted Solution

Using Unicode in PROC REPORT Pretext

I am trying to find a way to add unicode symbols in report pretext, specifically the ≥ symbol.  I am able to use superscripts in the text and make a footnote that uses the unicode symbols, but I can't figure out how to get it into the title.  Below are both examples (unicode atempt in a title and unicode in a footnote).  Can someone let me know if it is possible to use unicode in the pretext option?  I have heard people suggest copying the symbol from a Word document into my SAS code, but that doesn't work.  It may display in the code, but the output is just an equal (=) sign.

proc template;

   define style Styles.journal_noprehtml;

      parent = styles.Journal;

   style table from table / prehtml=''; /* Eliminate the 17 underscores after the report pretext */

   end;

run;

options formchar="|____|+|___+=|_/\<>*" pageno=1 nonumber nodate orientation=portrait center;

/***  Unicode in the title is not displaying correctly  ***/

ods listing close;

ods rtf file="C:\Class_Unicode.rtf" style=journal_noprehtml;

ods escapechar='~';

proc report data=sashelp.class nowindows style(report)={font=('Arial',9.5pt,bold italic) pretext="List of Students Weighing {\unicode 2265}100 Pounds"};

      where weight>=100;

run;

ods rtf close;

ods listing;

/***  I can superscript the title and use the unicode in a footnote  ***/

ods listing close;

ods rtf file="C:\Class_Superscript.rtf" style=journal_noprehtml;

ods escapechar='~';

proc report data=sashelp.class nowindows style(report)={font=('Arial',9.5pt,bold italic) pretext="List of Students{\super 1}"};

      where weight>=100;

run;

ods rtf text="~S={leftmargin=35% rightmargin=35% just=l font=('Arial', 9pt)}~{super 1} Only students weighing ~{unicode 2265}100 pounds are displayed.";

ods rtf close;

ods listing;


Accepted Solutions
Solution
‎01-09-2015 01:21 AM
Trusted Advisor
Posts: 1,300

Re: Using Unicode in PROC REPORT Pretext

The issue is that you are using UTF-16 hexadecimal when UTF-16 decimal is expected for RTF, so 8805 instead of 2265

proc report data=sashelp.class nowindows style(report)={font=('Arial',9.5pt,bold italic) pretext="List of Students Weighing \u8805? 100 Pounds"};

      where weight>=100;

run;

The \uc0 in 's example specifies that there will not be a substitute character for the next unicode sequence (the ? above...)

View solution in original post


All Replies
Super User
Posts: 9,681

Re: Using Unicode in PROC REPORT Pretext

Try this one . And better post such kind of questions at ODS and Base Reporting Cythina@sas is good at it .

proc report data=sashelp.class nowindows style(report)={font=('Arial',9.5pt,bold italic) pretext="List of Students Weighing \uc0\u8805 100 Pounds"};

      where weight>=100;

run;

Xia Keshan

Solution
‎01-09-2015 01:21 AM
Trusted Advisor
Posts: 1,300

Re: Using Unicode in PROC REPORT Pretext

The issue is that you are using UTF-16 hexadecimal when UTF-16 decimal is expected for RTF, so 8805 instead of 2265

proc report data=sashelp.class nowindows style(report)={font=('Arial',9.5pt,bold italic) pretext="List of Students Weighing \u8805? 100 Pounds"};

      where weight>=100;

run;

The \uc0 in 's example specifies that there will not be a substitute character for the next unicode sequence (the ? above...)

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 920 views
  • 3 likes
  • 3 in conversation