Hi, I am trying to figure out how to get the delta symbol and a superscript for one of my column headers to display in my proc report output, but I can't seem to get this to work. This is what I have so far. Any help is greatly appreciated!
options nodate nonumber center Orientation=landscape
topmargin=.5in bottommargin=.4in leftmargin=.5in rightmargin=.5in;
ods listing close;
protectspecialchars=off;
ods escapechar='^';
ods rtf file="&outpath&saveWordDoc..rtf" ;
title1 j=l font='Courier New' h=8pt "&titlename1 ^n &titlename2 ^n &titlename3" j=r "&sysdate9. &systime";
title2 j=l font='Courier New' h=8pt "&titleName4";
footnote j=l font='Courier New' h=8pt "&saveWordDoc..rtf" j=r "Page ^{thispage} of ^{lastpage}" ;
proc report nowd center spanrows missing split='^' data=all list out=test
style(report)=[width=100% frame=void rules=none cellspacing=0 padding=1pt font=('Courier New', 8pt)]
style(header)=[bordertopcolor=balck bordertopwidth=1
borderbottomcolor=black borderbottomwidth=1
background=white font=('Courier New', 8pt) textalign=c ]
style(column)=[font=('Courier New', 8pt) ASIS=ON ] ;
columns _PB_page vorder vid roworder rowlabel ("p-value^{super 1} LS Means^{unicode delta???} (95% CI)" col_4);
define _PB_page/group noprint;
A very common approach with testing something that "doesn't work" is to strip out as much unrelated code as possible so the only bit shown is actually pertinent.
Example:
ods escapechar='^'; proc report data=sashelp.class; column ('p-value^{super 1} LS Means^{unicode delta} (95% CI)' weight); define weight/display; run;
Which does display the superscript 1 and delta.
Then add options one at a time until it "doesn't work" again.
In this case it is the SPLIT option:
proc report data=sashelp.class split='^' ; columns ('p-value^{super 1} LS Means^{unicode delta} (95% CI)' weight); define weight/display ; run;
Which duplicates what you describe. SOLUTION: Either do not use the SPLIT option or use a different character and modify the labels to use that character.
What you failed to describe was that {super 1} and {Unicode delta} appeared at the start of separate lines within the header as the SPLIT character would do.
Hi:
Did you try unicode delta without the ??? -- it seemed to work for me. Just curious.
PS... not sure why you have the protectspecialchars=off; as a statement, you should be getting an error message like this:
ERROR 180-322: Statement is not valid or it is used out of proper order.
for that.
Cynthia
Sorry, I put the ??? to show where I was confused on what I should be adding there. I have tried it without the ???, but all it prints is the actual text"unicode delta". Am I supposed to define the unicode before or in my proc report statement? Thank you so much for your help!
Hi:
The code I posted is my entire code. You do need to establish your ODS ESCAPECHAR, as I show in my first line of code. But everything in my screen shot was produced by the code you see.
When I try using ODS RTF, I get this:
With this code:
ods escapechar='^';
ods rtf file='c:\temp\test_uni.rtf';
proc report data=sashelp.class(obs=3);
title 'this is^{super 1} and then something^{unicode delta}';
column ('Here is a delta^{unicode delta}' name age sex)
('and another^{super 2}' height weight);
run;
ods rtf close;
If you run my code and do not see the delta and the superscript in the RTF file, then you need to open a track with Tech Support.
Cynthia
I added the ODS escapechar and
('p-value^{super 1} LS Means^{unicode delta} (95% CI)' col_4);
and it still is only printing "unicode delta" and "super 1"
I am not sure what else could be going wrong
options nodate nonumber center Orientation=landscape
topmargin=.5in bottommargin=.4in leftmargin=.5in rightmargin=.5in;
ods listing close;
ods escapechar='^';
ods rtf file="&outpath&saveWordDoc..rtf" ;
title1 j=l font='Courier New' h=8pt "&titlename1 ^n &titlename2 ^n &titlename3" j=r "&sysdate9. &systime";
title2 j=l font='Courier New' h=8pt "&titleName4";
footnote j=l font='Courier New' h=8pt "&saveWordDoc..rtf" j=r "Page ^{thispage} of ^{lastpage}" ;
proc report nowd center spanrows missing split='^' data=all list out=test
style(report)=[width=100% frame=void rules=none cellspacing=0 padding=1pt font=('Courier New', 8pt)]
style(header)=[bordertopcolor=balck bordertopwidth=1
borderbottomcolor=black borderbottomwidth=1
background=white font=('Courier New', 8pt) textalign=c ]
style(column)=[font=('Courier New', 8pt) ASIS=ON ] ;
columns _PB_page vorder vid roworder rowlabel ('p-value^{super 1} LS Means^{unicode delta} (95% CI)' col_4);
A very common approach with testing something that "doesn't work" is to strip out as much unrelated code as possible so the only bit shown is actually pertinent.
Example:
ods escapechar='^'; proc report data=sashelp.class; column ('p-value^{super 1} LS Means^{unicode delta} (95% CI)' weight); define weight/display; run;
Which does display the superscript 1 and delta.
Then add options one at a time until it "doesn't work" again.
In this case it is the SPLIT option:
proc report data=sashelp.class split='^' ; columns ('p-value^{super 1} LS Means^{unicode delta} (95% CI)' weight); define weight/display ; run;
Which duplicates what you describe. SOLUTION: Either do not use the SPLIT option or use a different character and modify the labels to use that character.
What you failed to describe was that {super 1} and {Unicode delta} appeared at the start of separate lines within the header as the SPLIT character would do.
Thank you! It was the split option that was definitely throwing everything off
@kmardinian wrote:
Thank you! It was the split option that was definitely throwing everything off
Another possible solution would be a different ESCAPECHAR but that may cause more confusion.
I haven't used much of the SPLIT options recently but used to use * so habitually it took me a minute to realize your split character and escapechar were the same character.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.