x cd /pub/data/pums2000/Tools; %let pgm=constworkers_byage_stl; filename pgm "&pgm..sas"; *--For St. Louis public library. The request was to provide data on construction workers by age for the St. Louis area. July, 2003. Historic significance: our FIRST 2000 PUMS live query. ---; %libname (pums2000); libname user '/SAS_temp/user'; filename pumeq '../pumeq1-mo.txt'; *<--PUMA equivalncey file--; /*<=========================Comment out===================================== data pumaeqmo; infile pumeq firstobs=43 ; length SumLev $3 state $2 puma1 $5 cnty $3 msa $4; input sumlev 2-4 state 6-7 puma1 9-13 cnty 21-23 msa 46-49; run; proc sort data=pumaeqmo(where=(sumlev='791')) out=pumaeqco; by puma1 msa; run; %corrwt(setin=pumaeqco,setout=puma2msa, geocds1=puma1,geocds2=msa, weight=1,keepwt=1) proc print data=puma2msa; by puma1; id puma1; title2 'puma1 to msa corr list'; run; ===========================End commented out================================ */ *---results of the above tell us which puma1 codes correspond to the st louis msa--; data constwrks_stl; set pums2000.moprecs1(keep=puma1 pweight age occcen1 ); *--this where choose the geographic area - st louis msa - and occupation category - construction + extraction-; where puma1 in ('29600','29701','29702') and ('620' <= occcen1 <= '699'); run; proc sort; by age; run; ods html file="/pub/reports/temp/&pgm..html"; title 'Construction Workers by Age: Missouri Portion of the St. Louis MSA - 2000 Census (Estimates)'; title3 'Source: U.S. Bureau of the Census - Public Use Microdata Sample, 1 Pct Sample File'; footnote 'Report Produced by the Missouri Census Data Center'; footnote2 "Setup in pums2000/Tools/&pgm..sas"; proc freq data=constwrks_stl; weight pweight; table age; run; ods html close; options fmtsearch=(pums2000.formats1 sasctlgs); proc freq data=constwrks_stl; weight pweight; table occcen1; format occcen1 $occcen1_. ; run;