/************************************************************************************************************* 2004 March Supplement as originally released excluded noncash after tax income (http://www.nber.org/cps/cpsext04.txt). This file adds them back in. *************************************************************************************************************/ #delimit; capture log close; foreach file in hhext04 ffext04 ppext04 {; qui copy http://www.nber.org/data/progs/cps/`file'.do `file'.do, replace; !type `file'.do | findstr /v "local dat_name" | findstr /v "quietly infile" | findstr /v "saveold" >`file'x.do; *Removes lines with specified strings. The paths in Jean Roth's files are MAC paths, and I am too lazy to change them by hand.; qui copy http://www.nber.org/data/progs/cps/`file'.dct `file'.dct, replace; qui copy http://www.nber.org/cps/`file'.zip `file'.zip, replace; qui unzipfile `file'.zip, replace; qui infile using `file'.dct, using(`file'.dat) clear; do `file'x.do; if `"`file'"'==`"ppext04"' {; destring p_mvcaid, replace; *I don't know why it was read in as string but need to destring; }; qui save `file', replace; capture log close; foreach ext in .do x.do .dct .zip .dat .log {; erase `file'`ext'; }; }; qui copy http://www.nber.org/data/progs/cps/cpsext04.do cpsext04.do, replace; *File to merge everything together; !type cpsext04.do | findstr /v "do hhext04.do" | findstr /v "do ffext04.do" | findstr /v "do ppext04.do" | findstr /b /v "use" | findstr /v "log close" | findstr /b /v "clear" >cpsext04x.do; *I've already loaded the datasets and will load the March file myself; qui unzipfile `"$SavePath/CPS/March/cpsmar04"', replace; qui use cpsmar04; qui save cpsmar04original, replace; do cpsext04x.do; capture drop _m; capture log close; qui save cpsmar04, replace; qui zipfile cpsmar04.dta, saving(`"$SavePath/CPS/March/cpsmar04"', replace); qui zipfile cpsmar04original.dta, saving(`"$SavePath/CPS/March/cpsmar04original"', replace); foreach file in hhext04 ffext04 ppext04 cpsmar04original cpsmar04 {; erase `file'.dta; }; erase cpsext04x.do; erase cpsext04.do;