BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,
I would like to make a boxplot with SGRENDER. I am using customized format for the values of my independent variable. Now, I wanna add a superscript "[1]" in my format value and let it appear in the picture. By the way, my destination is RTF. How shall I make it? Thanks in advance!

Below is my code:

proc format;
value study 1='Neonates'
2='Infants'
3='Toddlers'
5='Children'
6='Adolencents'
7='Adults(K)\{super [1]}' /*This \{super [1]} does not work*/
11='Adults(S)'
;
run;

proc template;
define style Styles.boxplot;
parent = styles.statistical;
style GraphBox from Graphbox/
capstyle = "bracket";

style GraphBoxMean from GraphBoxMean /
markersymbol=" diamondfilled "
contrastcolor=GraphColors("gcdata1")
markersize = 3px;

end;

define statgraph box;
begingraph;
layout lattice /columns=1 rows=2;
layout overlay;
boxplot y=bw x=stud /display=(CAPS FILL MEAN MEDIAN NOTCHES OUTLIERS);
endlayout;
layout overlay;
boxplot y=pna x=stud /display=(CAPS FILL MEAN MEDIAN NOTCHES OUTLIERS);
endlayout;
endlayout;
endgraph;
end;
run;

ods rtf style= Journal;
ods ESCAPECHAR="\";
proc sgrender data=summary template=box;
run;
ods rtf close;
1 REPLY 1
KarlK
Fluorite | Level 6
Maurice,

This is a long shot, so if it doesn't work, I won't be surprised and apologize in advance for wasting the bandwidth.

Try changing your escapechar, to something like '^'. In my experience, '\' is unreliable as an escapechar. Why? I don't know for sure, but my theory is that: 1)
windows tries to use it as a sub-directory separator as in unix and gets confused in the ods context; 2) the RTF specification uses it as it's own escape character and ODS and RTF may be interacting in some way and so it doesn't behave as expected.

As I say, it's a long shot. Good luck.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 885 views
  • 0 likes
  • 2 in conversation