BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mariko5797
Pyrite | Level 9

As of right now, the output graph is writing out the text exactly rather than translating it to a superscript or less-than-or-equal-to symbol.

proc format;
 value $BMI
 	'Not Obese' 	= "BMI < 30 kg/m^{super 2}"
	'Obese'			= "30 ^{unicode 2264} BMI ^{unicode 2264} 40 kg/m^{super 2}"
	'Severely Obese'= "BMI > 40 kg/m^{super 2}"
	'All Subjects'	= "All Subjects";
run;

ods escapechar = "^";
proc sgpanel data = fig23 (where = (SPECTYPE ^in ("Breast Milk", "Plasma"))) pad = (top=5% bottom=5%) sganno = footnote3;
 panelby BMIGRP ABRV_SPECTYPE / layout = lattice onepanel novarname;
 histogram PCOMP / scale = count datalabel = count;
 format BMIGRP $BMI.;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

There are a few issues issues here:

First, @ballardw is correct. You MUST use the default escape char sequence, which is (*ESC*), when using inline functions in PROC FORMAT for ODS Graphics output, . In the procedures, you can use the redefined character.

Second, the SUP and SUB functions are supported only in annotation in the SGPANEL procedure. However, you CAN use the Unicode equivalent of s superscript 2 in your PROC FORMAT, which is '00b2'x.

Third, your Unicode specifications should be wrapped in single quotes, followed by an 'x' (for hex). For example: (*ESC*){unicode '00b2'x}

 

Hope this helps!

Dan

View solution in original post

3 REPLIES 3
ballardw
Super User

Try using *ESC* in place of the ^ in the format definitions.

 

 

DanH_sas
SAS Super FREQ

There are a few issues issues here:

First, @ballardw is correct. You MUST use the default escape char sequence, which is (*ESC*), when using inline functions in PROC FORMAT for ODS Graphics output, . In the procedures, you can use the redefined character.

Second, the SUP and SUB functions are supported only in annotation in the SGPANEL procedure. However, you CAN use the Unicode equivalent of s superscript 2 in your PROC FORMAT, which is '00b2'x.

Third, your Unicode specifications should be wrapped in single quotes, followed by an 'x' (for hex). For example: (*ESC*){unicode '00b2'x}

 

Hope this helps!

Dan

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 816 views
  • 1 like
  • 4 in conversation