x cd /pub/data/sf12000x/Tools; %let pgm=cnvt_sf12000x_mozips; filename pgm "&pgm..sas"; *----Specific occurrence of general convert routine. Run just for Missouri ZIP Codes, both complete and within-county. John Blodgett, OSEDA, Running 10-5-01 after completing creation of the stf901x2 zip summary sets. Creates: sf12000x.mozips and sf12000x.mozipcos Important NOTE!!: We use these data sets to create an update file and use it in setup cnvt_mo to update sf12000x.moi . ----*; title 'Convert Mo ZIP Code SF1 Data to SF1X Extract'; libname sf12000 '/pub/data/census_2000/sf12000' access=readonly; %libname(stf901x2); libname sf12000x '/pub/data/sf12000x'; *libname pl9490tx '/pub/data/pl9490/pl9490tx'; libname user '/tmp/storage/john'; *<==================; /*<=========================Comment out===================================== *---------------Part 1: Complete ZIPs------------------------------------*; data _2000s; length default=5; length esriid $42.; merge sf1.moph sf1.mopct; where sumlev='871'; by geocode; %include sascode(sf12000x.sas); keep sumlev geocode zcta5 zcta3 areaname areasqmi intptlon intptlat esriid; *--in addtion to totpop etc.--; run; proc sort data=_2000s; by zcta5; run; data sf1x.mozips(label='Mo ZIP Codes (ZCTAs)'); merge _2000s (in=in2k) stf901x2.mozips00(in=in90 keep=zcta5 geocode areaname totpop rename=(totpop=totpop90)); by zcta5; if in2k; change=totpop - totpop90; if totpop90 then pctchange=100*change/totpop90; run; proc print data=sf1x.mozips(obs=50); var _char_ totpop totpop90 change pctchange; title2 'Selected Vars from sf1x.mozips'; run; *--------------------Part 2: ZIPs Within Counties-------------------------------*; data _2000s2; length default=5; length esriid $42.; merge sf1.moph sf1.mopct; where sumlev='881'; by geocode; %include sascode(sf12000x.sas); keep sumlev geocode zcta5 zcta3 areaname county partflag areasqmi intptlon intptlat esriid; *--in addtion to totpop etc.--; run; proc sort data=_2000s2; by zcta5 county; run; ===========================End commented out================================ */ data sf1x.mozipcos(label='Mo ZIP Codes within Counties'); merge _2000s2 (in=in2k) stf901x2.mozipcos00(in=in90 keep=zcta5 county totpop rename=(totpop=totpop90)); by zcta5 county; if not in90 and substr(zcta5,4,2) ne 'HH' then do; _no90+1; if _no90 <= 250 then do; put _no90 3. +1 zcta5= county= ; delete; end; else abort abend; end; if in2k; change=totpop - totpop90; if totpop90 then pctchange=100*change/totpop90; run; proc print data=sf1x.mozipcos(obs=50); var _char_ totpop totpop90 change pctchange; title2 'Selected Vars from sf1x.mozipcos'; run;