Dear Ana
The problem you face occurs because of how Mata sometimes locks files.
The other most common problem with locking files is due to having the
text file open in an application like Excel when you are outputing from
Stata (that's the reason for the error message saying what it does).
The code below (between the snip marks) will solve this problem. Cut and
paste it into an editor, and save it as closeallfiles.ado in your
personal ado directory.
Next time you get a problem with file locking, just type:
closeallfiles
at the Stata command line.
Regards
Ian
snip===========
program closeallfiles
version 9
forvalues i=0(1)50 {
capture mata: fclose(`i')
}
end
snip===========
Rios Galvez, Ana R wrote:
I am trying to use the "tabout" command and I am getting the following error
messages:
tabout location gender using results.txt,
(note: file results.txt not found)
file results.txt could not be opened
fopen(): 603 file could not be opened
write_tab(): - function returned error
wrap_up(): - function returned error
do_output(): - function returned error
<istmt>: - function returned error
r(603);
tabout location gender using results.txt,replace
File results.txt
is already open inside another application.
Please close it before running tabout.
I do not have any file named "results". I have tried with several different
file names and I am still getting the same error message.
Could someone please help?
Thanks,
Ana Rios
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/