mac def macerror 0 if "$logname"=="" { noisily display "setmacs.do must include the name of the ${debug}log file that" noisily display "is being created." mac def macerror 1 exit } ${debug}log using $logname,replace ${debug}log off if "$datain"=="" { ${debug}log on noisily display noisily display "setmacs.do must include datain." mac def macerror 1 ${debug}log off } if "$dataout"=="" { ${debug}log on noisily display noisily display "setmacs.do must include dataout." mac def macerror 1 ${debug}log off } if "$datain"=="$dataout" & "$datain"~="" { ${debug}log on noisily display noisily display " The output file cannot replace the input file." noisily display "You must change the dataout macro in setmacs.do." mac def macerror 1 ${debug}log off } if "$family"=="" { ${debug}log on noisily display noisily display "setmacs.do must include family." mac def macerror 1 ${debug}log off } if real("$bloat")~=1 { mac def bloat 0 } if real("$compress")~=1 { mac def compress 0 } if real("$unix")~=1 { mac def unix 0 } if ($bloat==1 | $compress==1) & $unix==0 { ${debug}log on noisily display noisily display "Because the input data are compressed (or the output is to be compressed)" noisily display "setmacs.do must include " mac def macerror 1 ${debug}log off } mac def steps int(real("$steps")) if $steps==. | $steps==0 { ${debug}log on noisily display noisily display "setmacs.do must include the macro steps, an integar." mac def macerror ${debug}log off } capture prog drop doit prog def doit local i 1 while `i'<=$steps { local j "${match`i'}" local k "${break`i'}" if "`j'"=="" { ${debug}log on noisily display noisily display "setmacs.do must include match`i'" mac def macerror 1 ${debug}log off } if "`k'"=="" { ${debug}log on noisily display noisily display "setmacs.do must include break`i'" mac def macerror 1 ${debug}log off } local i=`i'+1 } end doit if "$retain"=="" | "$retain"=="none" { mac def retain=0 exit } if "$retain"=="all" { mac def retain=3 exit } capture prog drop doit prog def doit local temp 0 parse "$retain",parse(" ") while "`1'"~="" { if lower(substr("`1'",1,3))=="hhm" & `temp'<1 { local temp 1 } if lower(substr("`1'",1,5))=="year1" & `temp'<2 { local temp 2 } if lower(substr("`1'",1,5))=="year2" & `temp'<3 { local temp 3 } mac shift } mac def retain `temp' end doit exit 0