capture log close /* closes any old log files */ set logtype text set more off /* the program will not stop for the screen to scroll so you can run the program without watching it */ log using no1875a_create.log, replace clear /* clears any data in memory */ * set mem 4g infile using no1875a_household if rectype=="H" /* no1875a_household is the name of the household dictionary */ drop rectype /* drops the rectype variable since we are making a rectangular file */ sort municino enumdist reslsno aptlsno hhnbrno save tmph, replace clear quietly infile using no1875a_person /* person dictionary */ assert rectype=="H" | rectype=="P" drop if rectype=="H" drop rectype sort municino enumdist reslsno aptlsno hhnbrno pernumno /* merge municino enumdist reslsno aptlsno hhnbrno using tmph assert _merge==3 sort municino enumdist reslsno aptlsno hhnbrno pernumno save no1875a, replace erase tmph.dta log close */