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;
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...)
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
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...)
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.