Dear Statalisters,
I have searched in Stata list and do not believe that this has been covered specifically. Apologies in advance if it has.
I have several hundred files which I am running commands on in a looped command in Stata 14 (updated).
In a section of the commands, the error message
__000001 not found
r(111);
was given. This was when the commands were run for a file with no observations. The looped command worked fine for files with observations.
I also ran the same commands in this same specific file, not in a loop, and discovered that it occurred when I ran an egen command (by patid: egen onlyalcdata = min(alccodes) if patid !=.).
I tried putting the capture command in front of this and other commands, but this does not seem to have solved the problem. In the case of this specific command, capture cannot be combined with by.
I would be grateful for any help in ways to allow stata to run a looped command to run across files, even if it has no observations, or if the looped command has sub-commands that would otherwise generate this error mesage.
Thank you in advance for your expert advice.
I have searched in Stata list and do not believe that this has been covered specifically. Apologies in advance if it has.
I have several hundred files which I am running commands on in a looped command in Stata 14 (updated).
In a section of the commands, the error message
__000001 not found
r(111);
was given. This was when the commands were run for a file with no observations. The looped command worked fine for files with observations.
I also ran the same commands in this same specific file, not in a loop, and discovered that it occurred when I ran an egen command (by patid: egen onlyalcdata = min(alccodes) if patid !=.).
I tried putting the capture command in front of this and other commands, but this does not seem to have solved the problem. In the case of this specific command, capture cannot be combined with by.
I would be grateful for any help in ways to allow stata to run a looped command to run across files, even if it has no observations, or if the looped command has sub-commands that would otherwise generate this error mesage.
Thank you in advance for your expert advice.
Comment