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
Ammonite | Level 13

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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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