set more 1 set tr off do widen.wid if "`1'"=="debug" { set tr on mac def runcmnd do } else { mac def debug mac def runcmnd run } capture prog drop makewide prog def makewide drop _all getspace 80000 150 local i 1 $runcmnd getyrmo.wid $runcmnd fixmacs $runcmnd testmacs.wid if $macerror { exit 1 } while `i'<=$nmatches { mac def yr1=${yr1`i'} mac def yr2=$yr1 + 1 mac def match=$yr1$yr2 mac def j=1 while $j<=4 { mac def mo$j=${mo$j`i'} noisily display "First year & j-th month =" %4.0f $yr1 %4.0f ${mo$j} if ${mo$j}>=1 & ${mo$j}<=4 { char ${mo$j} if $unix & $bloat { !zcat $datain$match$char.dta.Z > ${temploc}junk.dta use ${temploc}junk,clear } else { use $datain$match$char,clear } gowide $unique } /* closes if ${mo$j} */ else if ${mo$j}~=. { noisily display "${mo$j} in line `i' of yearlist.raw invalid." } /*closes else regarding ${mo$j} */ mac def j=$j+1 } /* closes j */ mac def j=1 mac def first=1 while $j<=4 { mac def mo$j=${mo$j`i'} if ${mo$j}>=1 & ${mo$j}<=4 { char ${mo$j} if $first { use ${temploc}junk$char,clear erase ${temploc}junk$char.dta mac def first=0 } else { append using ${temploc}junk$char erase ${temploc}junk$char.dta } } /* closes if ${mo$j} */ mac def j=$j+1 } /* closes j */ save $dataout$match,replace if $unix & $compress { capture erase $dataout$match.dta.Z !compress $dataout$match.dta } erase ${temploc}junk.dta erase ${temploc}junk1.dta local i=`i' + 1 } /* closes i */ end makewide exit 0