BookmarkSubscribeRSS Feed
Almighty
Fluorite | Level 6

Hi

I wanted to make superscripts and subscrpts in the SAS dataset it self.

The data I have:

               TESTCD='INCL01'

               TEST="How to make (a+b)2 in this test and make subscript a2 for the same"

DATA NEED;

               TESTCD ="INCL01"

               TEST     ="How to make (a+b)39 in this test and make subscript a2 for the same" 

I need 39 as superscript and 2 as subscript...

Thanks for your time.

2 REPLIES 2
jakarman
Barite | Level 11

tekst layout - fonts are not part of characterset. By concept you cannot store basic text that way.
When going to do some output/reports you can do the tekst formatting as part of ODS.

---->-- ja karman --<-----
RW9
Diamond | Level 26 RW9
Diamond | Level 26

As Jaap has mentioned, superscript/subscript and all the fancy stuff is not part of the "data", it is only for display purposes.  Now you can have a dataset with the codes within ready for display such as:

data want;

     a="^{sub This text} is subscripted, and ^{super This Text} is superscripted"; output;

run;

ods escapechar="^";

ods rtf file="xxx.rtf" style=statistical;

proc report data=want nowd;

run;

ods rtf close;

And in the output file you will see super/sub scripted, but the data will still contain just the line presented in the datastep.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 10207 views
  • 0 likes
  • 3 in conversation