x cd /pub/data/pums2000/Tools; %let pgm=seniorrx_racealone; filename pgm "&pgm..sas"; /* ------------------------------------------------------------------------ Program: seniorrx_racealone Description: Tabulates poverty level for major race groups alone for persons whose poverty level has been determined. HTML report stored in /pub/reports/&folder -- see let folder below ------------------------------------------------------------------------ */ libname pums2000 "/pub/data/pums2000"; libname user "/SAS_temp/user"; proc format; value poverty 001-049 = '<.50' 050-074 = '.50-.74' 075-099 = '.75-.99' 100-124 = '1.00-1.24' 125-149 = '1.25-1.49' 150-199 = '1.50-1.99' 200-224 = '2.00-2.24' 225-249 = '2.25-2.49' 250-299 = '2.50-2.99' 300-high = '3.00 and over'; value $race 1 = 'White alone' 2 = 'Black or African American alone' 3 = 'American Indian alone and Alaska Native' 6 = 'Asian alone' 7 = 'Native Hawaiian and Other Pacific Islander alone' 8 = 'Some other race alone' 9 = 'Two or more major race groups'; run; data allracealone; set pums2000.mo5 (keep=age poverty race1 pweight puma1 hispan); where poverty > 0; /* compress 3, 4, 5 together using the following tests */ if race1 eq '4' then race1 = 3; if race1 eq '5' then race1 = 3; run; proc sort data=allracealone; by poverty; run; title1 "Poverty Level - Major Race Groups Alone"; title2 "Source: 2000 Decennial Census 5 Percent PUMS File"; footnote1 "Report generated by seniorrx_racealone.sas in /pub/data/pums2000/Tools"; %let folder=seniorrx; ods html file="/pub/reports/&folder./&pgm..html" style=sasweb;; ods listing close; proc tabulate data=allracealone; format poverty poverty. race1 $race.; freq pweight; class poverty race1; table all="Total"*f=comma9. race1="Race Group Alone"*f=comma9., poverty="Estimated Persons by Poverty Ratio" all="Total"*f=comma9.; run; ods html close;