BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hbunderw
Calcite | Level 5

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Your variables are getting truncated in the ATTRMAP. Make sure the length is long enough.

View solution in original post

4 REPLIES 4
Reeza
Super User

Your variables are getting truncated in the ATTRMAP. Make sure the length is long enough.

ballardw
Super User

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;
hbunderw
Calcite | Level 5

Thank you both.  Of course that's the correct answer.  I didn't realize that SAS still restricts character lengths to 8.

WarrenKuhfeld
Rhodochrosite | Level 12

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.

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
  • 4 replies
  • 1043 views
  • 1 like
  • 4 in conversation