BookmarkSubscribeRSS Feed
Skorobogatiji
Calcite | Level 5

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! 

 

https://www.rawsas.com/2018/03/bitcoin-sas-format/

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

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:

 

GraphCapturegrp.PNG

 

HTMLCapturehtml.PNG

 

PDFCapturepdf.PNG

 

RTFCapturertf.PNG

 

 

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;

 

 

SAS Innovate 2025: Register Today!

 

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.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1333 views
  • 4 likes
  • 2 in conversation