BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KrishnaChandra
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

KrishnaChandra
Calcite | Level 5

Thanks RW9 Smiley Happy

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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