Data visualization with SAS programming

Attribute maps in SGPANEL

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Attribute maps in SGPANEL

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;


Accepted Solutions
Solution
a week ago
Super User
Posts: 20,222

Re: Attribute maps in SGPANEL

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

View solution in original post


All Replies
Solution
a week ago
Super User
Posts: 20,222

Re: Attribute maps in SGPANEL

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

Super User
Posts: 11,554

Re: Attribute maps in SGPANEL

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;
New Contributor
Posts: 2

Re: Attribute maps in SGPANEL

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

Highlighted
SAS Super FREQ
Posts: 375

Re: Attribute maps in SGPANEL

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 124 views
  • 1 like
  • 4 in conversation