x cd /mscdc/data/saipe/Tools; %let pgm=saipe95.cnvt; filename pgm "&pgm..sas"; *--Read downloaded (from Bureau FTP server in /pub/housing/saipe/school_district_data directory, 2-4-99, circa 12:30 p.m. cst poverty estimates data (person 5-17 only) for u.s. school districts--; filename in '/mscdc/data/saipe/ussd95.dat'; filename report 'Missouri_1995_School_District_Povedrty_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; options ls=157 ps=60; data saipes; retain year '1995'; *<--data for income year of 93 but based on 94 residents--; retain vers 'FEB99'; 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 (SIC)' 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 5- 9 CCD District ID 11-45 District Name 47-54 Estimated Total Population 56-63 Estimated Population of Children 5 to 17 years of Age 65-72 Estimated Number of Poor Children 5 to 17 years of Age Related to the Head of Household 74-93 A tag indicating the file name and data of creation end of excerpt */ infile in ; input state $char2. +2 school $char5. areaname $11-45 totpope 47-54 pop5_17 56-63 poor5_17 65-72; 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.ussd95(label='School District Pov Ests 95 US' index=(state)); by state school; run; proc sql; *<--create views--; create view saipe.mosd95 as select *, put(school,$schcnvt6.) as modese from ussd95 where state='29'; create view saipe.kssd95 as select * from ussd95 where state='20'; create view saipe.ilsd95 as select * from ussd95 where state='17'; proc contents data=saipe.ussd95 directory; title3 'Contents Report'; run; %metahtml(path=%str(/mscdc/data/saipe),setin=ussd95) run; proc printto print=report new; options pageno=1 nodate ls=112 ps=120; proc print data=saipe.mosd95 u; by state; title1 'SAIPE Missouri School District Poverty Guesstimates for 1995'; id year school areaname; var totpope -- pctp5_17; sum totpope pop5_17 poor5_17; run;