I get this error when attempting to create and use an attribute map in PROC SGPANEL
ERROR 772-580: Syntax error: expecting a constant or a dynamic. Any assistance would be appreciated.
Here's my code:
data attrmap;
id="moy";
markercolor="black";
input value $ markersymbol $;
datalines;
JAN Circle
FEB Diamond
MAR Hash
APR Plus
MAY Square
JUN Star
JUL Triangle
AUG TriangleDown
SEP CircleFilled
OCT DiamondFilled
NOV SquareFilled
DEC StarFilled
;
run;
ods graphics / attrpriority=none;
proc sgpanel data=two dattrmap=attrmap;
panelby site/columns=3;
scatter x=tn y=lnvi/group=mo attrid=moy;
run;
Your variables are getting truncated in the ATTRMAP. Make sure the length is long enough.
Your variables are getting truncated in the ATTRMAP. Make sure the length is long enough.
If you do not define the length of a character variable with an informat, length or attrib statement prior to input the default length will be 8 characters. So your markersymbol values are only 8 characters long and cannot hold some of the text specified.
See
data work.attrmap; id="moy"; markercolor="black"; length markersymbol $ 15; input value $ markersymbol $; datalines; JAN Circle FEB Diamond MAR Hash APR Plus MAY Square JUN Star JUL Triangle AUG TriangleDown SEP CircleFilled OCT DiamondFilled NOV SquareFilled DEC StarFilled ; run;
Thank you both. Of course that's the correct answer. I didn't realize that SAS still restricts character lengths to 8.
SAS does not restrict the length of character variables to 8 characters. However, in some cases that is the default length. In other cases the default might be as large as 32K. For many variables, neither is desirable, so you should set your length to something more appropriate for your problem.
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.
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.