BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a sas dataset with a variable units and the values of the units are displayed alike this when i open the sas data set.

"Basophils(x10~{super3}/u)"

I am using proc report for rtf ods output.

When I run the program with option "ods escapechar='~';"
In the final RTF output the number 3 is not superscripted but displaying as "Basophils(x10super3/u)". I am sure i am doing something wrong. Can any one suggest a way by which, without changing the SAS dataset, I can get the superscipt displayed in rtf output.

Thanks
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
When I run this code (shown below), I do get the expected results (superscript, subscript and the dagger symbol). So I'm not sure what's going on with your program. However, I do believe that the correct syntax is:
~{super 3}
~{sub 3}
...note the space between the 'super' or 'sub' and the number to be superscripted or subscripted. If your data does NOT have a space, then I do not believe the "super3" would be recognized and you might have to change the data file so that you were using the correct syntax..

I wasn't sure of the purpose for the "/u" in the data -- however if you intend to use RTF control strings in the data, I believe the control string for underline is \ul, not /u, as described here:
http://support.sas.com/rnd/base/ods/templateFAQ/Template_rtf.html#control
and
http://www2.sas.com/proceedings/forum2007/151-2007.pdf

cynthia
[pre]
data use_esc;
length stringvar $50;
infile datalines;
input stringvar & $;
put _all_;
return;
datalines;
Basophils(x10~{super 3})
Blastomeres(x10~{sub 3})
Basophils ~{dagger}
;
run;

ods listing close;
ods rtf file='c:\temp\use_esc.rtf';
ods escapechar='~';

proc report data=use_esc nowd;
column stringvar;
define stringvar / display;
run;
ods rtf close;

[/pre]

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

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
  • 2 replies
  • 2923 views
  • 0 likes
  • 2 in conversation