I am trying to display the ≥ symbol (greater than or equal to) on y-axis in a plot using the sgplot procedure. But, the ≥ symbol is replaced by just the = symbol in the RTF document produced. The ≥ symbol is part of a string in a character variable.
Any suggestions?
Thanks,
KC
Can you post just the SGPLOT code you are using, along with any TITLE and FOOTNOTE statements.
Thanks!
Dan
Here is the sgplot code and the proc format code (no titles or footnote statements)
proc format library=work;
value yscale 200 = 'Treatment'
160 = 'Age ^{unicode 2265} 75'
140 = 'Age < 75'
100 = 'US'
80 = 'Outside US'
other = ''
;
run;
ods options orientation=portrait;
ODS ESCAPECHAR='^';
ods graphics on / border=off;
ods rtf file='C:\Users\Z1000\Desktop\newplot.rtf' sge=on;
proc sgplot data=combined sganno=anno;
scatter x=meanestimate y=Order / xerrorlower=MeanLowerCL xerrorupper=MeanUpperCL markerattrs=OR (symbol=DiamondFilled size=6);
refline 1/axis=x;
format Order yscale.;
xaxis label="Relative Rate" LABELATTRS=(Family='Arial' ) VALUEATTRS=(Family=Arial SIZE=10 ) type=LOG LOGBASE= 10 min=0.5 max=2 values = (0.5 1 2);
yaxis label="SubGroups" display=(nolabel) tickvalueformat=yscale. VALUEATTRS=(Family=Arial SIZE=10 ) offsetmin=0.1 offsetmax=0.1 VALUES = (80 100 140 160 200);
run;
ods rtf close;
Instead of using ODS ESCAPECHAR, you must use the default escape sequence, which is (*ESC*). There were issues with using user-defined ESCAPECHARs in the PROC FORMAT context. Plus, by using the default sequence, you are guaranteed that the format stored in the catalog will always work, regardless of how your program defines ESCAPECHAR. Let me know if that works for you.
Thanks!
Dan
Hi Dan,
I tried using the default escape sequence, but with no luck. The symbol does show up as its supposed to in the title and footnote statements no matter which escape sequence I use, but just not as an axis value for some reason.
What version of SAS are you using?
I am using SAS 9.4 (TS1M1) - Do I need TS1M3 for the code to work (I see that on some blogs)?
Yes, that is the issue. It was a recent development.
Thanks Dan! I should have probably mentioned that along with the code.Will try and see if the code works after upgrading to TS1M3 release.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.