x cd /pub/data/stf901x2/Tools; %let pgm=cnvtili_ksi; filename pgm "&pgm..sas"; *--Create stf901x2.ili from stf901.ili and stf901x2.ksi from stf901.ksi. Most of the work is done by the included stf901x2.sas module. This setup by J. Blodgett, OSEDA, 12-2001. Under contract with Mo Census Data Center. Being rerun 12-17-01 to fix problem with Asian1 variable. Original conversion was done in sf1990x.sas module in this lib, which is now obsolete (of historic interest only). In this run we convert data for the states of Illinois and Kansas for governmental units on the ili and ksi data sets. We keep sumlevs 140 and 150 on these sets because we do not have the 2000-geography versions of tract and bg level data to use as alternatives. --*; %libname(stf901); libname stf901x2 '/pub/data/stf901x2'; *============There are two major sections in this setup: First part converts the ili data set. Second part converts the ksi data set. =============*; *----------------------Part 1-------------------------------------------------------------*; %let state=17; %let geouniv=Illinois; %let geolevs=inventory summary levels; %let set=ili; data stf901x2.&set(label="Std 1990 STF1 Extract for &geouniv &geolevs" compress=yes); *--this step adapted from the stf901x conversion code and creates vars consistent with stf901x filetype-; length slvl $3 geocode $16 default=4; set stf901.&set (rename=(slvl=sumlev)); *<----note that we DO keep tract and block group summaries. Unlike when we processed moi.-; where sumlev in ('040' '050' '060' '140' '150' '155' '160' '500'); *--the following select group assigns the variable geocode based on values of slvl. note that it is critical that this code be consistent with that used in stf801x conversion so that we can match the data sets on geocode and slvl.; select (sumlev); when('040') do; if geocomp='00'; *<---omit other special geographic components; geocode=state; end; when('050') do; geocode=county; end; when('060') do; geocode=county||'-'||cousubfp; end; when('155') do; geocode=county||'-'||placefp; end; when('160') do; geocode=state||'-'||placefp; end; when('140') do; geocode=county||'-'||tract; end; when('150') do; geocode=county||'-'||tract||'-'||bg; end; when('500') geocode=state||'-'||cd; otherwise do; _nother+1; *--(not needed since we use a keep):drop _nother; if _nother le 5 then put _n_= sumlev= areaname= ' ***not processed'; delete; end; end; %include sascode(stf901x2)/source2; *<--this is also linked as stf901x2.sas in this Tools lib--; slvl=SumLev; keep areaname county placefp place cousubce cousubfp tract bg placesc placecc fipco cnty slvl; run; proc sort data=stf901x2.&set; by sumlev geocode; run; *------------Part 2-----------------------------------------------------------------------*; %let state=20; %let geouniv=Kansas; %let geolevs=inventory summary levels; %let set=ksi; data stf901x2.&set(label="Std 1990 STF1 Extract for &geouniv &geolevs" compress=yes); *--this step adapted from the stf901x conversion code and creates vars consistent with stf901x filetype-; length slvl $3 geocode $16 default=4; set stf901.&set (rename=(slvl=sumlev)); *<----note that we DO keep tract and block group summaries. Unlike when we processed moi.-; where sumlev in ('040' '050' '060' '140' '150' '155' '160' '500'); *--the following select group assigns the variable geocode based on values of slvl. note that it is critical that this code be consistent with that used in stf801x conversion so that we can match the data sets on geocode and slvl.; select (sumlev); when('040') do; if geocomp='00'; *<---omit other special geographic components; geocode=state; end; when('050') do; geocode=county; end; when('060') do; geocode=county||'-'||cousubfp; end; when('155') do; geocode=county||'-'||placefp; end; when('160') do; geocode=state||'-'||placefp; end; when('140') do; geocode=county||'-'||tract; end; when('150') do; geocode=county||'-'||tract||'-'||bg; end; when('500') geocode=state||'-'||cd; otherwise do; _nother+1; *--(not needed since we use a keep):drop _nother; if _nother le 5 then put _n_= sumlev= areaname= ' ***not processed'; delete; end; end; %include sascode(stf901x2)/source2; *<--this is also linked as stf901x2.sas in this Tools lib--; slvl=SumLev; keep areaname county placefp place cousubce cousubfp tract bg placesc placecc fipco cnty slvl; run; proc sort data=stf901x2.&set; by sumlev geocode; run; proc datasets library=stf901x2 nolist; modify ili; index create sumlev; index create county; modify ksi; index create sumlev; index create county; quit;