BookmarkSubscribeRSS Feed
Koke
Fluorite | Level 6

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
 

 

5 REPLIES 5
ballardw
Super User

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.

Koke
Fluorite | Level 6

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

Thank

DanH_sas
SAS Super FREQ

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

 

ChrisHemedinger
Community Manager

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

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
Koke
Fluorite | Level 6
 
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

SAS Innovate 2025: Register Now

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!

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
  • 5 replies
  • 1521 views
  • 0 likes
  • 4 in conversation