x cd /pub/data/georef/Tools; %let pgm=mocogeos10; filename pgm "&pgm..sas"; *---See the setup in mocogeos.sas for creation of base georef.mocogeos dataset. This new 2010 version will be different as follows: 1. cbsa (and modot?) codes updated to 2010 values. 2. Each of the regions is stored as a code and as a Name variable, differing by using a format spec to get name. (This varied in old mocogeos set). 3. Now called mocogeos10. The old mocogeos will still exist, for a while at least. 4. pop10 added with 2010 pop from sf1. 5. Adding areasqmi, landsqmi, intptlat and intptlon from sf1 headers, 2010 census. ---*; libname georef '/pub/data/georef'; libname sf12010x '/pub/data/sf12010x' access=readonly; libname sf1x (sf12010x); title "georef.mocogeos10: High Level Geocodes for Missouri Counties, Rev to 2010 Geography"; title2 "Revised August, 2012"; *<===============; footnote 'Report Produced by OSEDA, U. of Missouri Outreach and Extension'; data georef.mocogeos10(label='Mo County Geocodes, 2010'); length areaname $16. SumLev $3 State $2 fipco county $5 pop10 pop2k pop90 5 DED_Region DED_RegionName $3 RPC RPCName $2 UMX UMXName $3 UMX2 $2 dot dotName$2 aaa aaaName $2 CBSA CBSAName $5 CBSAtype $5 msa90 msa2k msa2kName $4 rpc02 $2 cnty $3; merge georef.mocogeos(drop=cbsa in=ingeos ) sf1x.moselectedinv(keep=cbsa MetDiv CSA county sumlev TotPop Areasqmi LandSQMI Intpt: where=(sumlev='050') rename=(TotPop=Pop10) in=insf1); by county; if not (ingeos and insf1) then do; put / _all_; abort abend; end; format County $mocnty16. DED_region $3. DED_RegionName $dedrgn. rpcName $rpcname. umxName $umxname. dot $2. dotName $modot. aaaName $aaa. cbsa $5. cbsaName $cbsa. msa2kName $metro. ; format pop90 pop2k pop10 comma7.; DED_regionName=DED_region; RPCName=rpc; UMXName=umx; dotName=dot; aaaName=aaa; CBSAName=cbsa; msa2kName=msa2k; length _temp $64; _temp=put(cbsa,$cbsa.); if index(_temp,'Metropol') then cbsatype='Metro'; else if index(_temp,'Micropol') then mtype='Micro'; else cbsatype=' '; drop _: ; run; options ls=160 ps=120; proc print data=georef.mocogeos10; by state sumlev; id fipco county; sum pop90 pop2k; title3 'Listing of the Dataset georef.mocogeos'; run; proc tabulate data=georef.mocogeos10 missing; *--some summary stats by various levels--; class dotName ded_regionName msa2kName cbsaName rpcName aaaName; var pop2k pop10; *** format msa2k $metro. cbsa $cbsa. rpc rpc02 $rpcname. ; table all='Missouri Totals' cbsa rpc , pop10=' '*(n='# cntys'*f=5. sum='2010 Pop'*f=comma9.) pop2k=' '*(sum='2000 Pop'*f=comma9.) ; title3 'Summaries for Various County-Based Regions'; run;