x cd /mscdc/data/stf803/Tools; %let pgm=tr90sl3c; filename pgm "&pgm..sas"; *--Create a 1980 STF3 data set aggregated to complete (unsplit) 1990 census tracts using a correlation list and apportioned 1980 stf3a dataset. This run only works with data for 3 counties: St. Louis, St. Louis City and St. Charles.--*; *--OUTPUT DATASET IS: stf803.tr90sl3c ; *<---------------------------; libname stf803sl '/mscdc/data/stf803/stlmsa.sdl'; *--subset from moapp and ilapp datasets; libname corrlst '/mscdc/data/corrlst/stlmsa'; libname stf803 '/mscdc/data/stf803'; libname temp '/SAS_temp'; /* <=================comment out steps==================== *---step 1: create input data subset---; data tempv/view=tempv; *set stf803sl.blkgrps(in=bg) * stf803sl.eds; *<--avoiding because tract var not used on eds set; * by state county mcd place tract; *--new code used to access complete dataset-; set stf803.stlmsa; where sumrylvl in ('15','16') and county in('189','183','510'); length bged $5; if blkgrp ne ' ' then bged=blkgrp; else bged=ed; rename county=cnty; drop aflags rural areaname; run; proc sort data=tempv out=temp; by state cnty mcd place tract bged; run; data aggin; merge temp(in=indata) corrlst.be80tr90(in=inclist drop=afact county); where cnty in ('183','189','510'); *<===3 counties only!==; by state cnty mcd place tract bged; if not (indata and inclist) then do; put indata= inclist= cnty= mcd= place= tract= bged= ; _nbad+1; if _nbad gt 20 then abort abend; drop _nbad; delete; end; run; proc sort out=temp.aggin; by state cnty tract90; run; ======================end comented steps==================== */ options mprint; %aggstf3(setin=temp.aggin, setout=stf803.tr90sl3c, aggby=state cnty tract90) proc print data=stf803.tr90sl3c(keep=state cnty tract90 t1i1); by state cnty; id state cnty; title2 'Output Dataset: stf803.tr90sl3c: 1980 STF3 data allocated ' 'to 90 tracts for 3-county area in STL'; sum t1i1; format t1i1 comma11.; run;