I am somewhat new to data driven formatting but sort of winging it. I have defined a format based on modified proc univariate output. The number of levels in the format is later used to select the number of intermediate colors in a gradient created with the color select macro. Is there a way to select the number of levels in a user defined format into a macro variable? I would like this to remain flexible so I would prefer to pull from the meta-data rather than manually count the number of levels defined (as is done now with the 10 argument in color-scale). I checked the formats dictionary table and there does not appear to be a variable corresponding to the number of levels in the format. Snippet of code below, thanks! PROC FORMAT;
VALUE RANKS
0="0"
1="1"
&&VAL_&H.-HIGH ="More than &&VAL_&H."
%MACRO MAKE_F (HOWMANY);
%DO I=1 %TO &HOWMANY.;
%LET K=%EVAL(&I.+1);
&&VAL_&I. - %EVAL(&&VAL_&K.-1)="&&VAL_&I. TO %EVAL(&&VAL_&K.-1)"
%END;
%MEND MAKE_F;
%MAKE_F (%EVAL(&H.-1));
RUN;
%INCLUDE "&PATH.\PROGRAMS\MACRO\COLOR_SCALE.SAS";
%COLORSCALE(AFD5E8,,CA5B5C, 10, ANNO);
... View more