BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11

Dear,

 

In my input dataset for a graph  has  following  values.  I used ods escapechar='~'; .  The title statement and foot note are shown  below.  The unicode in footnote and title are resolved to ≥ as needed.  But the dataset variable "value" unicode is not resolved. Please suggest. Thank you.

 

 

 

id            value
1 ~{unicode 2265} 65 years

 

 

title1   age ~{unicode 2265} 61

 

footnote1    age~{unicode 2265} 61

 

6 REPLIES 6
Tom
Super User Tom
Super User

Not sure if there is a way to use the same syntax as the TITLE statement uses.

But you can use a number of ways to enter unicode characters.

data test;
  test='age ≥ 61';
  output;
  test='age ' || 'E289A5'x || ' 61';
  output;
  test=unicode('age \u2265 61');
  output;
run;

image.png

knveraraju91
Barite | Level 11

Hi TOM,

 

Thank you for the help. how did you you the output your are showing.  i  am getting 

 

age = 61

 

 

knveraraju91
Barite | Level 11

Thank you for your time. I think it is utf-8 encoding.  

 

URLENCODING=SESSION
Specifies whether the argument to the
URLENCODE function and to the URLDECODE
function is interpreted using the SAS
session encoding or UTF-8 encoding.

knveraraju91
Barite | Level 11

Hi ,

 

I used this "~{unicode '2265'x}"    it resolved. i got the output i need. Thank you very much

Tom
Super User Tom
Super User

That doesn't get the unicode into the variable, but it does show it on the output.

Make sure to make the variable long enough since instead of the simple 3 bytes needed for that unicode character you will need to store the all of those other characters instead. The ~ (tilda) and the curly brackets  and the string unicode and the digits 2265.

data test;
  length test $80;
  test='age ≥ 61';
  output;
  test='age ' || 'E289A5'x || ' 61';
  output;
  test=unicode('age \u2265 61');
  output;
  test="age ~{unicode 2265} 61";
  output;
run;

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 3160 views
  • 3 likes
  • 3 in conversation