PROC GPLOT is creating all the pages, plotting all the rates, labeling the values of NUM correctly and drawing the reference line specified in the statement "HREF=staterate chref=red;".
It is drawing the confidence interval, specified in the ANNOTATE dataset, only on the first page. The code for this follows the example in
http://www2.sas.com/proceedings/sugi29/035-29.pdf:
if rate ^= . then do;
* A. Position the device at the lower bound of the symbol;
FUNCTION='MOVE'; XSYS='2'; YSYS='2'; X=LB; Y=num; OUTPUT;
* B. Create a blue, solid, thin line from the lower bound to the upper bound;
FUNCTION='DRAW'; XSYS='2'; YSYS='2'; X=UB; Y=num; COLOR='BLUE'; LINE=1; SIZE=1; OUTPUT;
* C. Draw the top portion of the upper bound vertical axis;
FUNCTION='DRAW'; XSYS='2'; YSYS='8'; X=UB; Y=+.1; COLOR='BLUE'; LINE=1; SIZE=1; OUTPUT;
* D. Draw the bottom portion of the upper bound vertical axis;
FUNCTION='DRAW'; XSYS='2'; YSYS='8'; X=UB; Y=-.2; COLOR='BLUE'; LINE=1; SIZE=1; OUTPUT;
* E. Position the device at the lower bound of the symbol and clear out the variables that don’t relate to the function being used in order to make debugging easier;
FUNCTION='MOVE'; XSYS='2'; YSYS='2'; X=LB; Y=num; COLOR='BLUE'; LINE=.; SIZE=.; OUTPUT;
* F. Draw the top portion of the lower bound vertical axis;
FUNCTION='DRAW'; XSYS='2'; YSYS='8'; X=LB; Y=+.1; COLOR='BLUE'; LINE=1; SIZE=1; OUTPUT;
* G. Draw the bottom portion of the lower bound vertical axis;
FUNCTION='DRAW'; XSYS='2'; YSYS='8'; X=LB; Y=-.2; COLOR='BLUE'; LINE=1; SIZE=1; OUTPUT;
end;
It is also labeling the rate, specified in the ANNOTATE dataset, but only on the first page.
* H. Label rates;
if id = '000000' then rate_label = '2008 state rate: '||put(rate,5.2);
else if rate = . then do;
rate_label = 'Fewer than 30 cases';
FUNCTION='LABEL'; XSYS='2'; YSYS='2';
x = 2; Y=num;
FONT='HELVETICA'; SIZE=.5; COLOR='BLACK'; TEXT=rate_label;
POSITION='5'; OUTPUT;
end;
else if rate ^= . then do;
rate_label = put(rate,5.2);
FUNCTION='LABEL'; XSYS='2'; YSYS='2';
x = 2; Y=num;
FONT='HELVETICA'; SIZE=.5; COLOR='BLACK'; TEXT=rate_label;
POSITION='5'; OUTPUT;
end;
How can I get the annotate dataset to apply to more than the first page?