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
SAS Super FREQ
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]

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