Help using Base SAS procedures

Superscript or Subscript in SAS dataset

Reply
Contributor
Posts: 34

Superscript or Subscript in SAS dataset

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.

Trusted Advisor
Posts: 3,215

Re: Superscript or Subscript in SAS dataset

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 --<-----
Super User
Super User
Posts: 7,997

Re: Superscript or Subscript in SAS dataset

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.

Ask a Question
Discussion stats
  • 2 replies
  • 1893 views
  • 0 likes
  • 3 in conversation