x cd /pub/data/stf903/Tools; %let pgm=read_ciesin_xpt; filename pgm "&pgm..sas"; *--read a 1990 stf903 file in xpt (transport) format from a cdrom mounted on mcdc--; *--For Bob Feldman (for Daryl Hobbs) 4-4-01--; *--John Blodgett, OSEDA, U. of Missouri Outreach & Extension; **********************NEEDS WORK TO ADD the non-place remainder of county data*********************; signon oseda; libname stf903o remote '/mscdc/data/stf903' server=oseda ; libname stf903 xport '/pub/data/stf903/sdplace.xpt' ; libname user '/SAS_temp/user'; *--we read a file with level 155 summaries for South Dakota and subset by selected counties in and around Miner country SD. --*; data forbob90; set stf903.sdplace stf903o.uscntys(in=inc); where state='46' and substr(county,3,3) in ('005','061','077','079','087','097','111'); length placename $40 cntyname $24 totpop white black other 5; cntyname=put(county,$county.); if inc then do; placefp='99999'; end; if placefp ne '99999' then do; length _arg $7; _arg=state||placefp; placename=put(_arg,$fplace.); end; else do; placefp='99999'; placename='Remainder of '||trim(put(county,$county24.)); end; totpop=p1i1; white=p8i2; black=p8i2; other=sum(of p8i3-p8i5); if inc then do; afact=1; output; end; else do; afact=1; output; *--output once for the place--; afact=-1; placefp='99999'; placename='Remainder of '||trim(put(county,$county24.)); output; *--and once with a negative 1 factor for the remainder of county--; end; keep county placefp placename--other place slvl afact; run; proc sort; by county placefp; run; %agg(setin=forbob90,setout=bob90agg,aggby=county placefp,facvar=afact, idvars=placename,aggvars=totpop--other,dropvars=_nag_ _lvl_) run; filename dlmout '/pub/data/temp/sdplaces90.csv'; %cnvtdlm(setin=bob90agg,names=1) run; /*<=========================Comment out===================================== data forbob2k; set pl942000.sdsl155; where substr(county,3,3) in ('005','061','077','079','087','097','111'); other=sum(of indian1 asian1 hawnpi1 other1); keep county areaname totpop white1 black1 other areasqmi; run; filename dlmout '/pub/data/temp/sdplaces.csv'; %cnvtdlm(setin=forbob2k,names=1,round=%str(.001)); run; ===========================End commented out================================ */