set more 1 /* File: 17th_pums_proc_2000.do Date: Feb 15, 2004 Desc: Prepares extract of 2000 Decennial Census PUMS 1% */ capture program drop rd2000 program define rd2000 version 7.0 * prepare basic state files from PUMSB2000 while "`1'"~="" { * * read household records * !cp "$d2000/pums_`1'.dat" "$d2000/PUMSBX.TXT" clear qui infile using "$do/17th_pums_h_2000.dct" if rectype=="H" * do "$do/17th_pums_h_label_2000.do" drop rectype sort serialno compress save "$work/h_2000_temp_`1'", replace * * read individual records * clear qui infile using "$do/17th_pums_p_2000.dct" if rectype=="P" * do "$do/17th_pums_p_label_2000.do" drop rectype sort serialno compress save "$work/p_2000_temp_`1'", replace * * attach household variables to individual records * merge serialno using "$work/h_2000_temp_`1'" assert _merge==2 | _merge==3 drop if persons==0 /* eliminates vacant houses */ assert _merge==3 /* which should leave only correct matches */ drop _merge sort serialno drop hfiller* pfiller* compress * * save transformed state files * save "$work/pums_2000_pre_`1'", replace * !rm "$d2000/PUMSBX.TXT" !rm "$work/p_2000_temp_`1'.dta" !rm "$work/h_2000_temp_`1'.dta" mac shift } end capture program drop all2000 program define all2000 version 7.0 * combine all variables in all state files from PUMSB2000 use "$work/pums_2000_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_2000_pre_`1'" mac shift } save "$work/pums_2000_pre_all", replace end /* use apa2000, apb2000, and apc2000 if memory constraints */ capture program drop apa2000 program define apa2000 version 7.0 * combine selection of variables in all state files from PUMSB2000 use region division state puma1 msapmsa1 persons unittype tenure /* */ value mrt1amt smocapi rent grapi bldgsz vehicl hht relate sex /* */ esr p18 p65 hinc finc hweight age educ marstat abwork speak /* */ engabil pob1 yr2us ctz clwkr indcen occcen1 incws weeks hours /* */ incse incint incss incssi incpa incret incoth inctot poverty mob pweight /* */ serialno /* */ using "$work/pums_2000_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_2000_pre_`1'", nolabel keep region division state puma1 msapmsa1 persons unittype tenure /* */ value mrt1amt smocapi rent grapi bldgsz vehicl hht relate sex /* */ esr p18 p65 hinc finc hweight age educ marstat abwork speak /* */ engabil pob1 yr2us ctz clwkr indcen occcen1 incws weeks hours /* */ incse incint incss incssi incpa incret incoth inctot poverty mob pweight /* */ serialno di "State = `1'" mac shift } save "$work/pums_2000_pre_half_a", replace end capture program drop apb2000 program define apb2000 version 7.0 * combine selection of variables in all state files from PUMSB2000 use region division state puma1 msapmsa1 persons unittype tenure /* */ value mrt1amt smocapi rent grapi bldgsz vehicl hht relate sex /* */ esr p18 p65 hinc finc hweight age educ marstat abwork speak /* */ engabil pob1 yr2us ctz clwkr indcen occcen1 incws weeks hours /* */ incse incint incss incssi incpa incret incoth inctot poverty mob pweight /* */ serialno /* */ using "$work/pums_2000_pre_`1'", clear mac shift while "`1'"~="" { append using "$work/pums_2000_pre_`1'", nolabel keep region division state puma1 msapmsa1 persons unittype tenure /* */ value mrt1amt smocapi rent grapi bldgsz vehicl hht relate sex /* */ esr p18 p65 hinc finc hweight age educ marstat abwork speak /* */ engabil pob1 yr2us ctz clwkr indcen occcen1 incws weeks hours /* */ incse incint incss incssi incpa incret incoth inctot poverty mob pweight /* */ serialno di "State = `1'" mac shift } save "$work/pums_2000_pre_half_b", replace end capture program drop apc2000 program define apc2000 version 7.0 use "$work/pums_2000_pre_half_a", clear append using "$work/pums_2000_pre_half_b", nolabel save "$work/pums_2000_pre_all", replace end /* program switches */ /* read raw data */ rd2000 01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 /* */ 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 /* */ 53 54 55 56 */ /* combine all variables in all state files (if RAM is sufficiently large) */ all2000 01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 /* */ 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 /* */ 53 54 55 56 /* /* combine main variables in all state files */ apa2000 01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 /* */ 28 apb2000 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 /* */ 53 54 55 56 apc2000 */ /* Copyright 2004 Sarah Gammage and John Schmitt This program and all programs referenced in it are free software. You can redistribute the program or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */