x cd /pub/data/sf12000x/Tools; %let pgm=cnvt_sf12000x_ccns; filename pgm "&pgm..sas"; *----Specific occurrence of general convert routine. Run just for Caring Community Partnerships and Nbhds (ccs and ccns) as defined in summer of 2001. See /pvt/projects/caringcomm/agg_cctables.sas for creation of the input sf1 data sets. John Blodgett, OSEDA, Initial coding Aug 6, 2001. ----*; title 'Convert Mo Caring Community Partnerships and Nbhds to SF1X Extract'; libname sf12000 '/pub/data/census_2000/sf12000' access=readonly; libname sf12000x '/pub/data/sf12000x'; libname pl9490tx '/pub/data/pl9490/pl9490tx'; libname user '/tmp/storage/john'; *<==================; *****running without a pct data set******************************; %macro fixname; if cc='13' then areaname=tranwrd(areaname,'PEMISCOT','Pemiscot'); *--patch to fix edited name in all upcase--; %mend fixname; *---------------Part 1: Complete Partnerships (cc's)-----------------------------*; data _2000s; length default=5; ****merge sf1.ccsph sf1.ccspct; set sf1.ccsph; **does not exist (yet)*** sf1.ccspct; by geocode; ***fixname; *<----no longer need to apply the fix here since it was applied during the (re)creation step--; %include sascode(sf12000x.sas); keep sumlev geocode cc areaname areasqmi intptlon intptlat esriid; *--in addtion to totpop etc.--; run; proc sort data=_2000s; by cc; run; data sf1x.ccs(label='Caring Community Partnership Areas'); *merge _2000s (in=in2k) pl9490tx.moschl00(in=in90 keep=cc geocode areaname totpop rename=(totpop=totpop90)); set _2000s; *<====; by cc; **if in2k; change=totpop - totpop90; if totpop90 then pctchange=100*change/totpop90; run; proc print data=sf1x.ccs(obs=50); var _char_ totpop poppsqmi tothhs over65 ; **** totpop90 change pctchange; title2 'Selected Vars from sf1x.ccs'; run; *--------------------Part 2: CC Neighborhhods - ccns-------------------------------*; data _2000s2; length default=5; ****merge sf1.ccsph sf1.ccspct; set sf1.ccnsph; **does not exist (yet)*** sf1.ccnspct; by geocode; *fixname; %include sascode(sf12000x.sas); keep sumlev geocode cc ccn areaname areasqmi intptlon intptlat esriid; *--in addtion to totpop etc.--; run; proc sort data=_2000s2; by ccn; run; data sf1x.ccns(label='Caring Community Neighborhoods'); ***merge _2000s2 (in=in2k) pl9490tx.moschlcopops(in=in90 keep=cc county totpop rename=(totpop=totpop90)); set _2000s2; *<===there is no 1990 pop set so no merge here==; by cc ccn; change=totpop - totpop90; if totpop90 then pctchange=100*change/totpop90; run;