x cd /mscdc/data/saipe/Tools; %let pgm=saipe95c.cnvt; filename pgm "&pgm..sas"; **the saipe95.cnvt.sas setup was used to convert the partial school district guesstimates**; *--Read downloaded (from Bureau FTP server in embargoes area - using copy on our PC platform as sent by D. Pitts, 2-10-99) income and poverty estimates data for Missouri (only, for now) counties--; *filename cntyin '/mscdc/data/saipe/est95_mo.dat'; filename cntyin '/mscdc/data/saipe/est95ALL.dat'; libname saipe '/mscdc/data/saipe'; title 'saipe95c.cnvt: Convert Income and Poverty Estimates Data for US ' 'States and Counties'; title2 '*** Run of 2-11-99 Using Entire US Data ***'; *options nocenter; options ls=157 ps=60; /* ****already uploaded it ****** *---go get the data off the s: drive on the lan, uploading to the saipe directory---; %let remote=&mypc; signon; rsubmit; proc download infile='s:\mscdc\saipe95.txt' outfile=cntyin; run; endrsubmit; data _null_; infile cntyin obs=40; file print; input; put _infil_; title3 'First 40 Lines on Input File'; run; ******* */ data saipes; retain year '1995'; *<--data for income year of 95 but based on 96 residents--; retain vers 'FEB99'; label vers='Version (Census Bureau Relase Date)'; length default=5; attrib slvl length=$3 format=$slvl. label='Geographic summary level' state length=$2 label='State FIPS code' stab length=$2 label='State Postal Abbrev' county length=$5 format=$5. cnty length=$3 label='County FIPS code' areaname length=$40 poor label='Total Persons Below Poverty' poorstd2 label='Width of 90% conf interval for poor' povuniv label='Persons for who pov status assigned' format=comma9. pctpoor length=4 format=f5.1 label= "% Poor, All Persons" pp1std2 label='Width 90% conf intvl %Poor All Persons' poor5_17 label='# of Poor related Children 5-17' p517std2 label='Width of 90% conf intrvl- poor 5-17' povu5_17 label='Pov Universe for 5-17 rel children' format=comma8. pctp5_17 label='% Poor, Children 5-17' format=f5.1 pp3std2 label='Width 90% conf intvl %Poor 5-17' medhhinc label='Median Household Income' format=dollar8. mhhistd2 label='Width of 90% conf intrval - Medhhinc'; attrib poor0_17 label='Poor Persons 0-17' p017std2 label='Width of 90% conf intrvl-poor 0-17' pctp0_17 label='% Poor, Persons 0-17' pp2std2 label='Width 90% conf intvl %Poor 0-17' povu0_17 label='Pov Universe for 0-17 Persons' ; /* Excerpt from the documentation file provided by the Census Bureau: III. Record Layout for Estimates Files Position Variable 1- 2 FIPS State code (00 for US record) 4- 6 FIPS county code ( 0 for US or state level records) 8- 15 Estimate of people of all ages in poverty 17- 24 90% confidence interval lower bound of estimate of people of all ages in poverty 26- 33 90% confidence interval upper bound of estimate of people of all ages in poverty 35- 38 Estimated percent of people of all ages in poverty 40- 43 90% confidence interval lower bound of estimate of percent of people of all ages in poverty 45- 48 90% confidence interval upper bound of estimate of percent of people of all ages in poverty 50- 57 Estimate of people age 0-17 in poverty 59- 66 90% confidence interval lower bound of estimate of people age 0-17 in poverty 68- 75 90% confidence interval upper bound of estimate of people age 0-17 in poverty 77- 80 Estimated percent of people age 0-17 in poverty 82- 85 90% confidence interval lower bound of estimate of percent of people age 0-17 in poverty 87- 90 90% confidence interval upper bound of estimate of percent of people age 0-17 in poverty 92- 99 Estimate of related children age 5-17 in families in poverty 101-108 90% confidence interval lower bound of estimate of related children age 5-17 in families in poverty 110-117 90% confidence interval upper bound of estimate of related children age 5-17 in families in poverty 119-122 Estimated percent of related children age 5-17 in families in poverty 124-127 90% confidence interval lower bound of estimate of percent of related children age 5-17 in families in poverty 129-132 90% confidence interval upper bound of estimate of percent of related children age 5-17 in families in poverty 134-139 Estimate of median household income 141-146 90% confidence interval lower bound of estimate of median household income 148-153 90% confidence interval upper bound of estimate of median household income NOTE: Columns 155-192 will be blank for all county-level records. These data are only available at the national and state-level. 155-161 Estimate of people under age 5 in poverty 163-169 90% confidence interval lower bound of estimate of people under age 5 in poverty 171-177 90% confidence interval upper bound of estimate of people under age 5 in poverty 179-182 Estimated percent of people under age 5 in poverty 184-187 90% confidence interval lower bound of estimate of percent of people under age 5 in poverty 189-192 90% confidence interval upper bound of estimate of percent of people under age 5 in poverty * 194-238 State or county name with numeric suffixes --note: confidence interval variables with numeric suffixes ( 240-241 Two-letter Postal State abbreviatione with alpha suffixes conflim1-conflim6) were on orginal (4/97) file. Those with were new with the Jan 98 version of the data---*; end of excerpt */ infile cntyin ; input state $char2. +1 cnty $char3. poor 8-15 conflim1 17-24 conflim2 26-33 pctpoor 35-38 conflima 40-43 conflimb 45-48 poor0_17 50-57 conflimc 59-66 conflimd 68-75 pctp0_17 77-80 conflime 82-85 conflimf 87-90 poor5_17 92-99 conflim3 101-108 conflim4 110-117 pctp5_17 119-122 conflimg 124-127 conflimh 129-132 medhhinc 134-139 conflim5 141-146 conflim6 148-153 stab $240-241 ; *--we do NOT READ the under-5 estimates, available only at the state level-; state=translate(state,'0',' '); cnty=translate(cnty,'0',' '); if cnty gt '000' then do; slvl='050'; county=state||cnty; areaname=put(county,$county.); end; else if state gt '00' then slvl='040'; else slvl='010'; *<--state and us-; if slvl='040' then areaname=put(state,$state.); else if slvl='010' then areaname='United States'; if pctpoor then povuniv=poor*100/pctpoor; if pctp5_17 then povu5_17=100*poor5_17/pctp5_17; if pctp0_17 then povu0_17=100*poor0_17/pctp0_17; poorstd2=(conflim2-conflim1)*.5; p517std2=(conflim4-conflim3)*.5; mhhistd2=(conflim6-conflim5)*.5; pp1std2=(conflimb-conflima)*.5; p017std2=(conflimd-conflimc)*.5; pp2std2=(conflimf-conflime)*.5; pp3std2=(conflimh-conflimg)*.5; drop conflim1-conflim6 conflima conflimb conflimc conflimd conflime conflimf conflimg conflimh; *--save vars with 2 standard deviation width values--; length poorstd2--pp3std2 4; run; proc sort out=saipe.us95(label='County pov and Med HH income ests 95' index=(state)); by state county; run; /* *<==========================COMMENT OUT for now..=========================== ========================end comment======================== */ proc sql; *<--create views--; create view saipe.usstates as select * from us95(drop=cnty county) where slvl='010' or slvl='040'; *<--US totals or state totals-; create view saipe.mo95 as select * from us95 where state='29'; create view saipe.il95 as select * from us95 where state='17'; create view saipe.ks95 as select * from us95 where state='20'; create view saipe.stlmil95 as select * from us95 where slvl='050' and state in ('29','17') and put(county,$cntymet.)='7040M'; quit; proc contents data=saipe.us95 directory; title3 'Contents Report'; run; proc print data=saipe.us95(obs=25); title3 'Sample Report - First 25 Obs of saipe.us95'; title3 'Has US, State and County Summaries'; by year state stab; id cnty county areaname; run; *proc print d data=saipe.stlmil95; * title3 'saipe.stlmil95 (St. Louis Mo-IL 1995 (view)'; * by year state stab; * run;