ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kmardinian
Quartz | Level 8

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;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

8 REPLIES 8
Cynthia_sas
SAS Super FREQ

Hi:

  Did you try unicode delta without the ??? -- it seemed to work for me. Just curious.

unicode_delta.png

 

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

kmardinian
Quartz | Level 8

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!

Cynthia_sas
SAS Super FREQ

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:

delta_rtf.png

 

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

kmardinian
Quartz | Level 8

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

Cynthia_sas
SAS Super FREQ
Hi:
Did you run MY code, exactly as I posted it? If you run MY code and it works, then you need to re-examine your code carefully to find the difference. If you run MY code exactly as I posted it and you do not see the delta or the superscript, then you need to open a track with Tech Support. They can look at ALL of your code and ALL of your data to determine whether it is due to that.

Also, I believe that the {unicode delta} capability was only available starting in SAS 9.2 or possibly 9.3 -- this is also something that you can check with Tech Support.

Cynthia
ballardw
Super User

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.

kmardinian
Quartz | Level 8

Thank you! It was the split option that was definitely throwing everything off

ballardw
Super User

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

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 6647 views
  • 0 likes
  • 3 in conversation