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-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!

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.

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