BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mariko5797
Pyrite | Level 9

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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;

Ksharp_0-1685783796691.png

 

View solution in original post

5 REPLIES 5
JosvanderVelden
SAS Super FREQ

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.

 

mariko5797
Pyrite | Level 9
The special characters, aside from beta, show up as question marks when I output.
JosvanderVelden
SAS Super FREQ

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:

JosvanderVelden_0-1685723350704.png

See also: https://communities.sas.com/t5/SAS-Programming/changing-the-encoding-of-my-SAS-session/td-p/726972

Ksharp
Super User

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;

Ksharp_0-1685783460249.png

 

Ksharp
Super User

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;

Ksharp_0-1685783796691.png

 

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 1090 views
  • 3 likes
  • 3 in conversation