I am trying to get the Greek letters to appear in the panel headers. I can get beta to show b/c SAS is able to recognize that character. But copying alpha into SAS shows up as 'a' and copying gamma into SAS shows up as '?'. Unicode works fine in titles but it does not seem to like in for panel headers. I saw a previous post from 2014 that said (*ESC*) (and similar) does not work with panel headers. Is this true? If so, are there other ways to obtain Greek letters in the headers?
proc format;
value $stype
"EGFRS" = "EGF" "ETXRS" = "Eotaxin" "FGFRS" = "FGF-2" "FLTRS" = "Flt-3L" "FRCRS" = "Fractalkine"
"GSFRS" = "G-CSF" "GMCRS" = "GM-CSF" "GRORS" = "GRO"
"I10RS" = "IL-10" "I40RS" = "IL12-P40" "I70RS" = "IL12-P70" "I15RS"= "IL-15" "I13RS"= "IL-13"
"IL2RS" = "IL-2" "IL3RS" = "IL-3" "IL4RS" = "IL-4" "IL5RS" = "IL-5" "IL6RS" = "IL-6"
"IL7RS" = "IL-7" "IL8RS" = "IL-8" "IL9RS" = "IL-9"
"I1RRS" = "IL1-RA" "I1BRS" = "IL-1ß" "I17RS" = "IL17A"
"P10RS" = "IP-10" "MP1RS" = "MCP-1" "MCPRS" = "MCP-3" "MDCRS" = "MDC" "MPBRS" = "MIP1ß"
"C40RS" = "sCD40L" "TFBRS" = "TNFß" "VEGRS" = "VEGF"
"IFYRS" = "IFN(*ESC*){unicode 03B3}" "IFARS" = "IFN(*ESC*){unicode 03B1}2"
"I1ARS" = "IL-1(*ESC*){unicode 03B1}" "MPARS" = "MIP1(*ESC*){unicode 03B1}"
"TGFRS" = "TGF-(*ESC*){unicode 03B1}" "TFARS" = "TNF(*ESC*){unicode 03B1}"
;
run;
ods graphics on / reset= index border= no width= 7.35in height= 9.0in attrpriority= none;
proc sgpanel data= rpt(where= (fig= "&FIG.")) dattrmap= attrmap noautolegend;
panelby stype / novarname rows= 5 columns= 1 uniscale= column headerattrs= (family= "Times New Roman");
series x= plvisdy y= med / group= grp attrid= prtct;
scatter x= plvisdy y= med / group= grp attrid= prtct yerrorupper= q3 yerrorlower= q1;
rowaxis label= "Additive Change from Baseline" /*logbase= 2 logstyle= logexpand type= log*/; /*Note: Cannot scale by log with zero present.*/
colaxis label= "Study Day" fitpolicy= stagger values= (1 29 57 71 85 120 141 176 323 379 558);
refline 1 29 57 85 141 / axis= x lineattrs= (pattern=4);
refline 176 379 / axis= x;
keylegend / across= 3 type= linecolor exclude= ('.') title= "Protection Status" noborder position= bottom;
format stype $stype.;
run;
ods graphics off; ods listing close;
ods word close;
Also could directly refer to Greek letter in UNICODE.
proc format;
value $ stype
"IBM" = "IFN(*ESC*){unicode alpha}"
"Intel" = "IL-1(*ESC*){unicode beta}"
"Microsoft" = "TGF-(*ESC*){unicode gamma}"
;
run;
Please have a look at the following code and analyze the output.
proc format;
value fmtyear
1993 = "(*ESC*){unicode '03B1'x}"
1994 = "(*ESC*){unicode '03B2'x}"
;
run;
libname sashutf8 "/home/&sysuserid/sashutf8" outencoding='UTF-8';
data sashutf8.prdsale;
set sashelp.prdsale;
if product eq 'BED' then product = "κρεβάτι";
else if product eq 'SOFA' then product = "καναπές";
else if product eq 'CHAIR' then product = "καρέκλα";
else if product eq 'DESK' then product = "γραφείο";
else product = "άγνωστος";
format year fmtyear.;
run;
proc sgpanel data=sashutf8.prdsale;
title "Ετήσιες πωλήσεις ανά προϊόν";
panelby year / novarname columns=1;
hbar product / response=actual;
run;
title;
NOTE: I've run this on SAS OnDemand for Academics.
SAS executes on which operating system? Do you know how to start SAS with unicode support?
This is part of my output on SAS OnDemand for Academics:
See also: https://communities.sas.com/t5/SAS-Programming/changing-the-encoding-of-my-SAS-session/td-p/726972
Your usage of UNICODE is not right .
proc format;
value $ stype
"IBM" = "IFN(*ESC*){unicode '03B3'x}"
"Intel" = "IL-1(*ESC*){unicode '03B1'x}"
"Microsoft" = "TGF-(*ESC*){unicode '03B1'x}"
;
run;
data have;
set sashelp.stocks;
format stock $stype.;
run;
proc sgpanel data=have noautolegend;
panelby stock / novarname layout=panel onepanel rows=3 uniscale= column ;
series x= date y= close/group=stock;
run;
Also could directly refer to Greek letter in UNICODE.
proc format;
value $ stype
"IBM" = "IFN(*ESC*){unicode alpha}"
"Intel" = "IL-1(*ESC*){unicode beta}"
"Microsoft" = "TGF-(*ESC*){unicode gamma}"
;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.