set mem 500m log using rw_keep , text replace set more off * by Jean Roth, 2004-03-22, jroth@nber.org local monlist jan feb mar apr may jun jul aug sep oct nov dec local yearlist 00 01 02 #delimit ; local keeplist qstnum hryear4 neio1icd nworwgt neerncov hrmonth occurnum neio1cow ntio1ocd nwsswgt neernlab ; #delimit cr foreach year in `yearlist' { foreach mon in `monlist' { display "20`year' `mon'" use /homes/web/html/data/progs/cps-basic/rw`mon'`year' *keep `keeplist' *drop if nwsswgt == 0 tostring qstnum , replace tostring occurnum , replace *rename hryear4 year *rename hrmonth intmonth *sort qstnum intmonth year occurnum save /homes/web/html/data/progs/cps-basic/rw`mon'`year' *save /homes/data/morg/annual/rw/rw`mon'`year' , replace } } exit,clear