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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1185 views
  • 0 likes
  • 4 in conversation