Data visualization with SAS programming

Inserting Superscripts in Proc Format

Reply
New Contributor
Posts: 2

Inserting Superscripts in Proc Format

I am trying to include superscripts in individual panel labels using sgpanel. I have created the labels using proc format and the value statement, but I am having issues when I actually try to insert superscripts (of 1, 2, 3, etc).

 

After doing some research, it seems that it should be possible to insert superscripts into proc format value statements using (*ESC*) and the unicode value, but when I do this in SAS 9.4 it just prints everything out in the string. An example of the code I'm using is below. I've never called unicode values before so am not feeling confident about that either, but right now I just want it to not print the entire thing in a string.

 

I have additional labels but cut it down here to be concise. I then call the panel_var format in sgpanel.

 

proc format;

value panel_var 0='BSI(*ESC*){unicode "207A"x}(*ESC*){unicode "2071"x}'

1="Externalizing Problems";

run;

 

 

ods graphics on/ border=off width=11in height=8in;

ods rtf file="C:\filepath\filename.rtf" style=journal2;

proc sgpanel data=adj noautolegend;

panelby panel_var / columns=3 rows=4 uniscale=column novarname;

refline 0/axis=y;

scatter x=visit y=beta/yerrorupper=upper yerrorlower=lower;

format visit visit. panel_var panel_var.;

colaxis min=0.8 max=7.2 values=(1,2,3,4,5,6,7) valueshint;

rowaxis integer;

run;

ods rtf close;

SAS Super FREQ
Posts: 862

Re: Inserting Superscripts in Proc Format

What version of SAS 9.4 are you running? This feature was released in SAS 9.4m3. Run this code and post the result fromn your log:

 

%put &sysvlong;

 

Thanks!

Dan

New Contributor
Posts: 2

Re: Inserting Superscripts in Proc Format

Thanks for your speedy reply. Log results: 9.04.01M2P072314

 

If I can't do it using this version, is there another way?

SAS Super FREQ
Posts: 862

Re: Inserting Superscripts in Proc Format

It looks like your using SAS 9.4m2, which is why it did not work for you. As a possible alternative, take a look at Prashant Hebbar's paper (https://support.sas.com/resources/papers/proceedings13/371-2013.pdf). Starting on page 10, he talks about embedding unicode characters directly in your data set. You might be able to do this in a temporary data set to get the effect you want.

 

Hope this helps!

Dan

Post a Question
Discussion Stats
  • 3 replies
  • 88 views
  • 0 likes
  • 2 in conversation