x cd /pub/data/sf32000x/Tools; %let pgm=cnvtsf3x_moregns; filename pgm "&pgm..sas"; /*---Access Census 2000 full sf3 datasets and create standard extract datasets and/or metadata (Variables) dataset. Input filetype is sf32000, output filetype is sf32000x. For the moregns and moregns06 datasets. John Blodgett, OSEDA, U. of Missouri Outreach & Extension. Under contract with the Missouri Census Data Center. Run 12-14-02. and again 2-9-06 to convert the morgns06 dataset. ---*/ %let setin=moregns; %let dvmode=data; *--required by dovar macro which is invoked dozens of times by the invoke_dovars module--; title "&pgm: Create sf32000x Extract Datasets from sf32000 Datasets"; *----the dovar macro is where the work is actually done. Below, the cnvtmeta macro serves as the "driver" which invokes this macro one per variable. It gets run once in data more and once in meta mode--; libname sf3 "/pub/data/sf32000" access=readonly; libname sf32000x "/pub/data/sf32000x"; *----the dovar macro is where the work is actually done. Below, the included invoke_dovars.sas serves as the "driver" which invokes this macro once per variable. It gets run once in data mode only here---; options NOmprint; data sf32000x.moregns (label='Missouri county-based regions as defined circa 2002') ; length default=5 Obs 3 esriid $3; set sf3.moregns; label esriid='Id field to link to ESRI map files'; %include 'invoke_dovars.sas'/NOsource2; esriid=compress(geocode,'-.'); grcid=esriid; label grcid='Id field to link to GRC/MsDIS map files (Mo only)'; keep _character_; keep TotPop -- grcid; *** label Obs='Observation #'; run; run; proc print data=sf32000x.moregns(obs=100); title2 'First 100 Obs from sf32000x.moregns'; by SumLev notsorted; id geocode ; var region rpc dot ded_region umx2 areaname totpop; run; *--------------------and now do the updated for 2006 versions that has new data for the 06 and 08 (Lake Ozark and Meramec) RPCs and new summarie for aaa regions------------------------------; data sf32000x.moregns06 (label='Missouri county-based regions as defined circa 2006') ; length default=5 Obs 3 esriid $3; set sf3.moregns06; label esriid='Id field to link to ESRI map files'; %include 'invoke_dovars.sas'/NOsource2; esriid=compress(geocode,'-.'); grcid=esriid; label grcid='Id field to link to GRC/MsDIS map files (Mo only)'; keep _character_; keep TotPop -- grcid; *** label Obs='Observation #'; run; proc print data=sf32000x.moregns06(obs=100); title2 'New or modified data from sf32000x.moregns06'; where (sumlev='rpc' and rpc in ('06','08')) or sumlev='aaa'; by SumLev notsorted; id geocode ; var region rpc aaa areaname totpop; run;