x cd /pub/data/blkrel10/Tools; %let pgm=block_split_counts; filename pgm "&pgm..sas"; *---We look at the block relationships to try and get a handle on how many blocks really got split (significantly). We somewhat arbitrarily say that if a block is 90% or more associated with a 2010 blocks then this was just a minor realignment and it is essenitally the same area. (Fudge!) We do reports showing the number of such blocks by county within a state and we also do the 2k pop counts associated with split and unsplit blocks. jgb, 6-14-12. ---*; libname blkrel '/pub/data/blkrel10'; libname user '/SAS_temp/user'; %let stab=mo; %let statenm=Missouri; title "Analysis of Block Splitting Between 2000 and 2010 Based on Census Bureau Block Relationship Data"; title2 "For state of &statenm"; data splits; set blkrel.&stab.blks(keep=state2k cnty2k tract2k blk2k pflag2k arealand2k afactland pop2kInt pop2k); *** where cnty2k in ('019', '510'); ***<====; by state2k cnty2k tract2k blk2k; if first.blk2k then do; if arealand2k=0 and pop2k=0 then delete; *--ignore water blocks--; maxafact=afactland; retain maxafact; end; else if afactland > maxafact then maxafact=afactland; if last.blk2k then do; if pop2k=0 then Populated='No '; else Populated='Yes'; if maxafact = 1.0 then Split='Not at all '; else if maxafact >= .90 then Split='Trivial'; else Split='Non-Trivial'; length County $5; County=state2k||cnty2k; format county $county.; keep state2k county Populated Split pop2k; end; run; *ods listing close; ods html file="&statenm. &pgm..html" style=analysis; proc tabulate; class populated Split County; variable pop2k; table County All='State Totals' , Populated all='All Blocks', Split*(pop2k=' '*n='# Blks'*f=comma6. pop2k=' '*sum="2k Census Pop"*f=comma9.) all*f=comma6.; footnote .h=1 "Report Produced by Setup in blkrel10/Tools/&pgm..sas"; footnote2 'Water Blocks Ignored'; footnote3 '"Trivial" Splits are When 90+ Percent of 2k Blocks Goes with a 2010 Block'; run; ods html close; %include sascode (notify);