x cd /mscdc/data/saipe/Tools; %let pgm=saipe97sd.cnvt; filename pgm "&pgm..sas"; *--Read downloaded (from Bureau FTP server in /housing/saipe/sd97 directory, 11-30-00 poverty estimates data (person 5-17 only) for u.s. school districts. Data is for the 1998 population using income data for 1997--; filename in '/mscdc/data/saipe/ussd97.dat'; filename report '/mscdc/data/saipe/Missouri_1997_School_District_Poverty_Estimates'; libname saipe '/mscdc/data/saipe'; title 'saipe95.cnvt: Convert School District Poverty Estimates Data for US '; title2 '*** Run of Feb 4, 1999 White the Data is Brand New! ***'; *options nocenter; data saipes; retain year '1997'; *<--data for income year of 93 but based on 94 residents--; retain vers 'NOV00'; label vers='Version (Census Bureau Release Date)'; length default=5; attrib slvl length=$3 format=$3. label='Geographic summary level' state length=$2 label='State FIPS code' school length=$5 label='School District (LEA Code)' stab length=$2 label='State Postal Abbrev' areaname length=$36 label='District Name' totpope length=4 label='Estimated Total Pop ' format=comma9. pop5_17 length=4 label='Estimated Pop Age 5-17' poor5_17 length=4 label='Estimated Poor Age 5-17' pctp5_17 label='% Poor, Children 5-17 ' format=f5.1 ; *--- Here is an extract cut and pasted from the "readme" file on the ftp site: Record Layout for Files Position Variable 1- 2 FIPS State code (00 for US record) 4- 8 CCD District ID 10-74 District Name 76-83 Estimated Total Population 85-92 Estimated Population of Children 5 to 17 years of Age Related to the Head of Household 94-101 Estimated Number of Poor Children 5 to 17 years of Age Related to the Head of Household 103-122 A tag indicating the file name and data of creation end of excerpt ----; infile in ; input state $char2. +1 school $char5. areaname $10-65 totpope 76-83 pop5_17 85-92 poor5_17 94-101; state=translate(state,'0',' '); stab=put(state,$fipstab.); retain slvl 'SCH'; school=translate(school,'0',' '); *<--insert leading zeroes--; if pop5_17 then pctp5_17=100*poor5_17/pop5_17; *<--this is NOT!!! percent poor. we do not have the true poverty universe--; run; proc sort out=saipe.ussd97(label='School District Pov Ests 97 US' index=(state)); by state school; run; *---Forget the state views. Create Missouri subset---; data saipe.mosd97(label='MO Sch. District Pov ests 97-98'); attrib distcode length=$6 label='DESE District Code'; set saipe.ussd97; where state='29'; distcode=put(school,$schcnvt6.); run; proc sql; *<--create views--; proc contents data=saipe.ussd97; title3 'Contents Report'; proc contents data=saipe.mosd97; run; proc printto print=report new; options pageno=1 nodate ls=112 ps=120; proc print data=saipe.mosd97 u label; title1 'SAIPE Missouri School District Poverty Guesstimates Based on 1997 Income'; title2 'Population Estimates are For 1998'; id school distcode areaname; var totpope -- pctp5_17; sum totpope pop5_17 poor5_17; run;