Data visualization with SAS programming

symbol in proc SGPLOT

Reply
Occasional Contributor
Posts: 17

symbol in proc SGPLOT

Hi all,

I want to use 'a^' as a mark in my plot2, but I don't know how to combine the character (a) with symbol(^). Need help

data sat;
infile datalines firstobs = 3 delimiter='.' truncover ;
input year 4. @6 L_quart 5. U_quart
;
datalines;
Year Lower Upper
Quart Quart
2015 1200 1360
2014 1170 1330
2013 1170 1330
2012 1140 1330
2011 1130 1320
2010 1110 1310
2009 1140 1310
2008 1120 1290
2007 1130 1300
2006 1150 1310
;
proc
print data = sat;
PROC SGPLOT DATA = sat;
symbolchar name=plot1 char='0056'x;
symbolchar name=plot2 char='0061'x/'02C4'x;
SCATTER X = year Y = L_quart / MARKERATTRS = (SYMBOL=plot1 size=12pt);
SCATTER X = year Y = U_quart / markerattrs=(symbol=plot2 size=12pt);
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 data sat;
63 infile datalines firstobs = 3 delimiter='.' truncover ;
64 input year 4. @6 L_quart 5. U_quart
65 ;
66 datalines;
 
NOTE: The data set WORK.SAT has 10 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
 
79 ;
 
80 proc
81 print data = sat;
 
NOTE: There were 10 observations read from the data set WORK.SAT.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.19 seconds
cpu time 0.16 seconds
 
82 PROC SGPLOT DATA = sat;
 
83 symbolchar name=plot1 char='0056'x;
84 symbolchar name=plot2 char='0061'x/'02C4'x;
_______
22
200
ERROR 22-322: Syntax error, expecting one of the following: ;, HOFFSET, ROTATE, SCALE, TEXTATTRS, VOFFSET.
ERROR 200-322: The symbol is not recognized and will be ignored.
85 symbolchar name=plot3 char='02C4'x ;
86 SCATTER X = year Y = L_quart / MARKERATTRS = (SYMBOL=plot1 size=12pt);
87 SCATTER X = year Y = U_quart / markerattrs=(symbol=plot2 size=12pt);
88
89
90 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
103
 

 

Super User
Posts: 11,343

Re: symbol in proc SGPLOT

Would you like the ^ over the A? That may be the unicode 00C2, or 00E2 in lower case.

The syntax implies only a single character is allowed.

Occasional Contributor
Posts: 17

Re: symbol in proc SGPLOT

I would like to have both of them come together like this  'a^' not separate like this 'a' '^'. 

Thank

SAS Super FREQ
Posts: 939

Re: symbol in proc SGPLOT

[ Edited ]

If you are really wanting "a^" (two adjacent characters as one symbol), your best option is to retain a column in your datastep with that string, and use the MARKERCHAR option to reference it. Do something like the following:

 

 

data sat;
infile datalines firstobs = 3 delimiter='.' truncover ;
retain mysymbol "a^";
input year 4. @6 L_quart 5. U_quart
;
datalines;
Year	Lower	Upper
	Quart	Quart
2015	1200	1360
2014 	1170	1330
2013	1170	1330
2012	1140	1330
2011	1130	1320
2010	1110	1310
2009	1140	1310
2008	1120	1290
2007	1130	1300
2006	1150	1310
;
proc
print data = sat;
PROC SGPLOT DATA = sat; 
symbolchar name=plot1 char='0056'x;
SCATTER X = year Y = L_quart / MARKERATTRS = (SYMBOL=plot1 size=12pt);
SCATTER X = year Y = U_quart / markerchar=mysymbol markerattrs=(size=12pt);

 

Hope this helps!

Dan

 

Community Manager
Posts: 2,955

Re: symbol in proc SGPLOT

@Koke, SYMBOLCHAR was added in 9.4M1 -- what version are you running? See this SAS note.

Occasional Contributor
Posts: 17

Re: symbol in proc SGPLOT

Posted in reply to ChrisHemedinger
 
For Base SAS Software ...
Custom version information: 9.4_M4
Image version information: 9.04.01M4P110916
For SAS/STAT ...
Custom version information: 14.2
For SAS/ETS ...
Custom version information: 14.2
For SAS/IML ...
Custom version information: 14.2
For High Performance Suite ...
Custom version information: 2.2_M5
For SAS/ACCESS Interface to PC Files ...
Custom version information: 9.4_M4
 
This is what it shows when I run the PROC product status
thank
Ask a Question
Discussion stats
  • 5 replies
  • 230 views
  • 0 likes
  • 4 in conversation