x cd /pub/data/pums2000/Tools; %let pgm=persinc; filename pgm "&pgm..sas"; /* ------------------------------------------------------------------------ Program: persinc Description: Calculates average and median personal income for state by race and educational level HTML report stored in /pub/reports/&folder -- see let folder below ------------------------------------------------------------------------ */ libname pums2000 "/pub/data/pums2000"; libname user "/SAS_temp/user"; proc format; value educ 00 = 'Not in universe (Under 3 years)' 01 = 'No schooling completed' 02 = 'Nursery school to 4th grade' 03 = '5th grade or 6th grade' 04 = '7th grade or 8th grade' 05 = '9th grade' 06 = '10th grade' 07 = '11th grade' 08 = '12th grade, no diploma' 09 = 'High school graduate' 10 = 'Some college, but less than 1 year' 11 = 'One or more years of college, no degree' 12 = 'Associate degree' 13 = "Bachelor's degree" 14 = "Masters degree" 15 = 'Professional degree' 16 = 'Doctorate degree'; value $cmbeduc low-08 = 'Not completed High-School' 09 = 'High-School graduate' 10-12 = 'Some college' 13 = "Bachelor's degree" 14-high = "Master's, Professional, Doctorate degree"; value $race '1'='White alone' '2'='Black or African American alone' '3'='American Indian alone' '4'='Alaska Native alone' '5'='American Indian and Alaska Native alone' '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 alleducation; set pums2000.mo5 (keep=age educ pweight race1 puma1 incws); where incws > 0; run; title1 "Average and Median Personal Income for State of Missouri "; title2 "Missouri Residents 4-1-2000 who worked in 1999"; footnote1 "Source: 2000 Decennial Census 5 Percent PUMS File"; footnote2 "Report generated by persinc.sas in /pub/data/pums2000/Tools"; %let folder=persinc; ods html file="/pub/reports/&folder./&pgm..html" style=sasweb;; ods listing close; proc tabulate data=alleducation; format educ $cmbeduc. race1 $race.; var incws; freq pweight; class educ race1; table all="Missouri Total" race1="Race", (educ all) * (incws*(n*f=comma7. mean*f=dollar8. median*f=dollar8.)); run; ods html close;