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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 4024 views
  • 1 like
  • 2 in conversation