Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Tabout

From   Ian Watson <>
Subject   Re: st: Tabout
Date   Tue, 22 May 2007 13:00:22 +1000

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:


at the Stata command line.




program closeallfiles
	 version 9

	 forvalues i=0(1)50 {
		    capture mata: fclose(`i')


Rios Galvez, Ana R wrote:
I am trying to use the "tabout" command and I am getting the following error

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

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?


Ana Rios
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index