I'm running a do-file (too long to reproduce here) that defines a program dfbounds and am experiencing what seems to me to be very odd behavior. I'm 99.9% certain that the same code had no problem running previously but can't be absolutely sure this is correct.
The top of the code that defines the program is
I then ran the program using auto.dta
The results were as follows
Thinking that perhaps my executable somehow got corrupted I ran this but the problem persisted
I'm at wits' end trying to figure out what's going on. Why does the program run properly with an if statement but not without an if statement?
Any suggestions? Thanks very much in advance. Happy to buy a pint for the first person who figures this out.
The top of the code that defines the program is
Code:
cap prog drop dfbounds prog define dfbounds version 17.0 syntax varlist [if] [in] [, savedat(string)]
Code:
sysuse auto dfbounds rep78 foreign dfbounds rep78 foreign if mpg>20, savedat(testdat, replace) dfbounds rep78 foreign, savedat(testdat, replace)
Code:
. sysuse auto
(1978 automobile data)
.
. dfbounds rep78 foreign
[output suppressed but program executed properly]
. dfbounds rep78 foreign if mpg>20, savedat(testdat, replace)
[output suppressed but program executed properly]
file testdat.dta saved
.
. dfbounds rep78 foreign, savedat(testdat, replace)
options not allowed
r(101);
end of do-file
r(101);
Thinking that perhaps my executable somehow got corrupted I ran this but the problem persisted
Code:
update all, force
Any suggestions? Thanks very much in advance. Happy to buy a pint for the first person who figures this out.

Comment