Using the SAS GraphApplet - SAS Program
/* gr_ap.sas example using the SAS Institute graph applet */
%global ind;
%global sub;
/* for testing
%let ind = COUNTY;
filename _webout 'd:\junk\mw_gr_ap.htm';
*/
data _null_;
file _webout;
put 'Content-type: text/html'//;
i = symget('ind');
i = upcase(i);
if i = 'COUNTY' then call symput('sub','VARNAME');
else do;
call symput('sub','COUNTY');
call symput('ind','VARNAME');
end;
proc format cntlout=cntlfmt;
value $incfmt
"BINC046" = "dividends,interest,rent($000)"
"BINC060" = "other labor income ($000)"
"BINC071" = "proprietors-farm ($000)"
"BINC072" = "proprietors-nonfarm ($000)"
"BINC010" = "total personal income ($000)"
"BINC047" = "transfer payments ($000)"
"BINC050" = "wages and salaries ($000)"
;
value ctyfmt
45 = 'Douglas County'
91 = 'Johnson County'
103 = 'Leavenworth County'
177 = 'Shawnee County'
209 = 'Wyandotte County'
;
data income;
input
VARNAME $ COUNTY YEAR VALUE;
format varname $incfmt.;
format county ctyfmt.;
label value = 'Personal Income ($000)'
varname= 'Source of Income'
county = 'County';
datalines;
BINC010 45 1996 1717030
BINC010 91 1996 14388279
BINC010 103 1996 1284268
BINC010 177 1996 3935869
BINC010 209 1996 2695987
BINC046 45 1996 334872
BINC046 91 1996 3131236
BINC046 103 1996 176272
BINC046 177 1996 725067
BINC046 209 1996 285841
BINC047 45 1996 221762
BINC047 91 1996 1125585
BINC047 103 1996 234394
BINC047 177 1996 650327
BINC047 209 1996 650027
BINC050 45 1996 917607
BINC050 91 1996 7227771
BINC050 103 1996 689679
BINC050 177 1996 2661434
BINC050 209 1996 2546335
BINC060 45 1996 110747
BINC060 91 1996 774747
BINC060 103 1996 59990
BINC060 177 1996 299117
BINC060 209 1996 358317
BINC071 45 1996 6313
BINC071 91 1996 4882
BINC071 103 1996 3441
BINC071 177 1996 12277
BINC071 209 1996 1642
BINC072 45 1996 89634
BINC072 91 1996 1064438
BINC072 103 1996 76169
BINC072 177 1996 211447
BINC072 209 1996 91861
;
proc sort data=income; by &ind ⊂ run;
%ds2graf(data=income,
cntlout=cntlfmt,
htmlfref=_webout,
depvar=value, indepvar=&ind, sbgrpvar=&sub,
name=income, graphtyp=bar,
drildown=n,
archive=/sasweb/graph/GraphApp.jar,
bgtype=color, bg=#e0e0e0,
ttag=bold + italicized, center=n,
tcolor=#002288, tface="Arial, Helvetica", tsize=5)
back to the overview