BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
djbateman
Lapis Lazuli | Level 10

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;

1 ACCEPTED SOLUTION

Accepted Solutions
FriedEgg
SAS Employee

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

2 REPLIES 2
Ksharp
Super User

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

FriedEgg
SAS Employee

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...)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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