x "rm ./elecanim.htm"; filename _webout './elecanim.htm'; data results; length st $2 winner $5; input st votes winner; datalines; ME 4 Kerry NH 4 Kerry MA 12 Kerry RI 4 Kerry CT 7 Kerry VT 3 Kerry NY 31 Kerry NJ 15 Kerry DE 4 Kerry MD 10 Kerry DC 3 Kerry PA 21 Kerry VA 13 Bush NC 15 Bush WV 5 Bush SC 8 Bush GA 15 Bush FL 27 Bush TN 11 Bush KY 8 Bush OH 20 Bush AL 9 Bush MS 6 Bush IN 11 Bush MI 17 Kerry IL 21 Kerry WI 10 Kerry MO 11 Bush IA 7 Bush AR 6 Bush MN 10 Kerry LA 9 Bush KS 6 Bush NE 5 Bush OK 7 Bush SD 3 Bush TX 34 Bush ND 3 Bush CO 9 Bush WY 3 Bush NM 5 Bush MT 3 Bush UT 5 Bush ID 4 Bush AZ 10 Bush NV 5 Bush OR 7 Kerry WA 11 Kerry CA 55 Kerry AK 3 Bush HI 4 Kerry ; run; data results; set results; order+1; state=stfips(st); statenam=fipnamel(state); run; goptions device=javameta; /* Since v9.2, you use sas.graph.metaviewapplet.jar, as follows ... */ data _null_; file _webout ; put ''; put ''; put ' MetaJava Map '; put ''; put ''; put ''; put ' '; put ' ] to begin animation.';"); else if _n_ > 1 then call execute("footnote ls=1.5 c=gray 'Press [||] to pause animation.';"); call execute("proc gmap map=maps.us (where=(statecode ne 'PR')) data=subset all; "); call execute("id state; choro winner / midpoints='Bush' 'Kerry' cempty=gray33 coutline=graydd nolegend; run;"); run; /* complete the rest of the html file */ data _null_; file _webout MOD; /* MOD makes this append */ put '">'; put ''; put ''; put ''; run; quit;