can you help me figure out why I am getting errors with this supposedly simple loop and scan? I'm trying to add a color to the attribute map. %let VarName = strength_; /* specify name of grouping variable */ proc freq data=Have ORDER=FORMATTED; /* or ORDER=DATA|FREQ */ tables &VarName / out=Attrs(rename=(&VarName=Value)); run; %let colorlist=blue, red, green, lightblue, cyan, orange, fuscia, brown, lavendar, purple ; %LET color_count = %sysfunc(countw(%quote(&colorlist), %str(,) )) ; data DAttrs; ID = "&VarName"; set Attrs(keep=Value); length linecolor $11. linecolor $100. ; do i = 1 to %eval(&color_count.) ; linecolor = %scan(&colorlist., i ) ; put linecolor ; end ; run;
... View more