Label format subscript

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

Label format subscript

Hai

  Please verify the code

data Task.LSLabel;

length var1 $75.;

var1='FEF25-75% (L/S) (Baseline from P301)';

run;

  Actually i need to get the Var1=FEF25-75% (L/S) (Baseline from P301) but now it seems to be FEF25-75% (L/S) (Baseline from P301).

Any way to solve this one


Accepted Solutions
Solution
‎09-19-2014 06:22 AM
Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Label format subscript

Hi,

This is called super or sub scripting.  To get these types of characters you need to "escape" your text.  First set the escape character - this is the character in the data which, when followed by { indicates the text is special.

ods escapechar="^";

Now I create some test data, note that the escape char is present, within the curly braces I indicate that I want sub or super script, then place the text, and finish with another curly brace.

data have;

     aa="This is a string with a ^{super 25-75%} and a ^{sub 25-75%} in it"; output;

run;

Now I print that dataset to a file to see the results.

ods rtf file="s:\temp\rob\test.rtf";

proc print data=have;

run;

ods rtf close;

View solution in original post


All Replies
Solution
‎09-19-2014 06:22 AM
Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Label format subscript

Hi,

This is called super or sub scripting.  To get these types of characters you need to "escape" your text.  First set the escape character - this is the character in the data which, when followed by { indicates the text is special.

ods escapechar="^";

Now I create some test data, note that the escape char is present, within the curly braces I indicate that I want sub or super script, then place the text, and finish with another curly brace.

data have;

     aa="This is a string with a ^{super 25-75%} and a ^{sub 25-75%} in it"; output;

run;

Now I print that dataset to a file to see the results.

ods rtf file="s:\temp\rob\test.rtf";

proc print data=have;

run;

ods rtf close;

Frequent Contributor
Posts: 89

Re: Label format subscript

Thanks RW9 Smiley Happy

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 188 views
  • 1 like
  • 2 in conversation