Application of bitcoin format for SAS users. This post also applies to other cryptocurrencies such as Ether and altcoins and integrating them into the SAS platform. Check it out!
The syntax to use Unicode characters varies wildly, depending on where in SAS one uses them.
SAS/GRAPH titles require a different syntax than SAS/GRAPH legends, which is again different from what ODS Graphs understands, which is also different from what ODS reports need.
Here is a summary of my findings. I am just displaying an exponent here, like this:
Graph
HTML
PDF
RTF
ODS Graphs seem to behave differently than when I last tested these syntaxes. Oh well...
title; %***************** SAS/GRAPH **********; %let a=%sysfunc(unicodec(TRT A 5x10, utf16b),$hex40.)00b92070; %let b=%sysfunc(unicodec(TRT B 1x10, utf16b),$hex40.)00b900b9; %put &=a ;%put &=b; legend value=(font="arial unicode ms/unicode" "&a"x "&b"x) ; axis value=(font="arial unicode ms/unicode" "&a"x "&b"x font="arial" /* for GIF for next values on axis*/); goptions ypixels=200 xpixels=320 dev=gif; title1 h=1 font="arial unicode ms" "TRT A 5x10^{super 10}" ;* no /unicode; title2 h=1 font="arial unicode ms" "TRT B 1x10^{super 11}" ;* for title!; proc gplot data=SASHELP.CLASS; plot WEIGHT*AGE=SEX/legend=legend1 haxis=axis1; note c=black f='arial unicode ms/unicode' m=(20,50)pct h=3 "&a"x; note c=black f='arial unicode ms/unicode' m=(20,40)pct h=3 "&b"x; run; quit; goptions dev=actximg; title; proc gplot data=SASHELP.CLASS; plot WEIGHT*AGE=SEX/legend=legend1 haxis=axis1; run; quit; %***************** ODS GRAPH **********; proc format ; value $sup_sg 'F'="TRT A 5x10(*ESC*){unicode '00b9'x}(*ESC*){unicode '2070'x}" 'M'="TRT B 1x10(*ESC*){unicode '00b9'x}(*ESC*){unicode '00b9'x}" ; ods graphics on / width=620px height=400px; proc sgpanel data=SASHELP.CLASS; format SEX $sup_sg.; panelby SEX / novarname headerattrs=GraphUnicodeText; scatter x=WEIGHT y=HEIGHT; run; %***************** ODS REPORT **********; ods escapechar='^' noproctitle; proc format ; value $sup_ods 'F'="TRT A 5x10^{super 10}" 'M'="TRT B 1x10^{super 11}" ; proc freq data=SASHELP.CLASS; format SEX $sup_ods.; table SEX; run; data TEST; X="TRT A 5x10^{super 10}"; run; title "TRT A 5x10^{super 12}"; ods rtf file="%sysfunc(pathname(WORK))\test.rtf" ; ods pdf file="%sysfunc(pathname(WORK))\test.pdf" ; ods html file="%sysfunc(pathname(WORK))\test.html" ; ods excel file="%sysfunc(pathname(WORK))\test.xls" ; proc print data=TEST noobs; run; ods _all_ close;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: