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

Dear all,

do you know whether it is possible in SAS 9.4 to get special characters into the labels on axes or panel headers in statistical graphics procedures? E.g. the below works for getting the greek character into the title, but the panel header does not resolve the ^{unicode lambda} bit and just displays that verbatim. Is there some way to make this work with SGPLOT/SGPANEL in this manner or does one need to resolve it via the choice of fonts (see second code below)?

ods escapechar="^";

data xxx;
  cat="Parameter ^{unicode lambda}";
  x=1; y=1; output;
  x=2; y=2; output;
run;
title "Parameter ^{unicode lambda}";
proc sgpanel;
  panelby cat;
  series x=x y=y;
run;

The below actually works for getting a special character into the panel header, but then I cannot add any "normal" test such as "Parameter" in a normal font, any longer.

data xxx;
  cat="l";
  x=1; y=1; output;
  x=2; y=2; output;
run;

proc sgpanel;
  panelby cat / HEADERATTRS=(family="Times New Roman Symbol");
  series x=x y=y;
run;

Does anyone have any ideas for how to get this to work so that I could have a panel header saying e.g. "Parameter λ" or "log(λ)" etc.?

Thanks for any ideas.

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

We support inline UNICODE escapement in any string that is specified, such as axis labels, legend labels, etc. However, we do not currently support escapement from within the data.

View solution in original post

5 REPLIES 5
ballardw
Super User
From the online help in SAS 9.3:
^{UNICODE <unicode-value | 'unicode-value'X>}
'unicode-value'X

is syntax used with STAT/GRAPH. A hexadecimal value
is enclosed in single or double quotes followed by an X. The
X specifies that the value in quotes is a hexadecimal value. This
quoted value must be an actual four-place hexadecimal Unicode value or one of
the names listed in the Base.Template.Tagsets template. For example, 03B2 is the
Unicode value for the Alpha symbol. For
details about Unicode values, see
Using
Unicode Symbols
.

So you may need to look up the code values instead of shorthand such as Lambda

DanH_sas
SAS Super FREQ

We support inline UNICODE escapement in any string that is specified, such as axis labels, legend labels, etc. However, we do not currently support escapement from within the data.

BjoernHolzhauer
Obsidian | Level 7

Thanks, good to know that at the moment I cannot get it to work that way.

kschless
Calcite | Level 5

Has this changed in SAS 9.4? I need special characters for my panel headers.

djrisks
Barite | Level 11

Have you got SAS 9.4 Maintenance release 3? I believe you should be able to do that in this release.

Here is a blog from Sanjay Matange:

http://blogs.sas.com/content/graphicallyspeaking/2015/07/29/unicode-in-formatted-data-sas-9-40m3/

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
  • 5 replies
  • 2242 views
  • 0 likes
  • 5 in conversation