x cd /pub/data/stf901x2/Tools; %let pgm=stf901x2_molegdists; filename pgm "&pgm..sas"; *--Run by JGB, 8-7-01. Create 1990 stf1 std extract for Mo House and Senate--; *--Revised to edit senate/geocode/esriid in mosenate00 set, 9-15-01-; %libname(stf901); libname stf901x2 '/pub/data/stf901x2'; libname mohsc901 server=oseda.demoserv sapw=giveme; *----Create stf901x2.mohouse00--; data stf901x2.mohouse00(label='MO State House Districts as Defined in 2000'); length geocode sldl esriid $3 default=4; set mohsc901.house ; *--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.; retain sumlev '620'; geocode=house; sldl=house; esriid=house; keep house esriid areaname; %include sascode(stf901x2); *<---the basic transformation takes place here-------------; run; proc sort; by geocode; run; *----Create stf901x2.mosenate00--; data stf901x2.mosenate00(label='MO State Senate Districts as Defined in 2000'); length geocode sldu esriid $3 senate $3 default=4; set mohsc901.senate ; *--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.; retain sumlev '610'; *--the geocode senate was stored as $2 in input set. We used length stmt prior to set to extend its length to 3, but now we have to pre-append the extra '0'--; senate='0'||senate; geocode=senate; sldu=senate; esriid=senate; keep senate esriid areaname; %include sascode(stf901x2); *<---the basic transformation takes place here-------------; run; proc sort; by geocode; run;