x cd /pub/data/corrlst/Tools; %let pgm=mobl2schl05; filename pgm "&pgm..sas"; *----Create the 2005 census block to school district corrleation list using CSV file created by Lance Huntley, 11-06 using latest district polygons from GRC/MsDIS and doing a block centroid pt-in-polygon operation. J. Blodgett, 11-27-06. Outputs are: corrlst.&pgm These results should be incorporated into the mable geographic data base sometime in lated 2006 or earlt 2007. ----*; filename in pipe 'unzip -p ../mobl2schl05.zip'; libname corrlst '/pub/data/corrlst'; title "Creating corrlst.&pgm : Missouri Block to 2005 School Districts Corr List"; data corrlst.&pgm(label='MO 2005 Census Block to School District' drop=distname) names(keep=drop=state tract block); length State $2 County $5 Tract $7 Block $4 DESEcode $7 ncescode $6 DistType $1; infile in firstobs=2 obs=max dsd missover termstr=crlf; length _esriid $16 _codist $7 DistName $40 ; input _esriid _codist distname disttype ncescode; State=substr(_esriid,1,2); County=substr(_esriid,1,5); Tract=substr(_esriid,6,4)||'.'||substr(_esriid,10,2); Block=substr(_esriid,12,4); desecode=compress(_codist,'-'); if DistType='K' then DistType='U'; *--value of K-12 corresponds to a Unified district--; if state ne '29' or length(block) ne 4 or not ('29001' le county le '29510') then do; _error_=1; _nerr+1; if _nerr ge 10 then abort abend; end; else if _n_ le 5 then put / _all_; drop _: ; run; proc sort data=corrlst.&pgm nodupkeys; by county tract block; run; proc contents data=corrlst.&pgm; proc print data=corrlst.&pgm(obs=100); by state county; id tract block; title2 "Sample Listing of corrlst.&pgm"; run; proc sort data=names nodupkeys out=names2; by ncescode desecode disttype distname county; run; proc print data=names2; by ncescode; id ncescode; title2 'District Names'; run; proc freq data=names; table disttype county desecode; format desecode $3. county $mocnty.; run;