Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: import excel - requiring restart occasionally


From   Billy Schwartz <wkschwartz@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: import excel - requiring restart occasionally
Date   Thu, 3 Nov 2011 16:25:25 -0400

Thanks! Just out of curiosity: I noticed that import excel is
implemented in Mata -- will that source code be made public?


On Thu, Nov 3, 2011 at 4:01 PM, Kevin Crow, StataCorp LP
<kcrow@stata.com> wrote:
>
> Billy Schwartz <wkschwartz@gmail.com> wrote :
>
> >"describe" eventually lead to increasing numbers of error 603's when
> >running the import command. Restarting Stata seems to fix it.
>
> >Facts: I have 947 Excel workbooks, both .xls and .xlsx, averaging just under 3
> >sheets per book, and I have to organize them. As a first step I've written a
> >Stata script to create a table of the sheet names in each workbook. It loops
> >through the *.xls* file names in my folder and runs "import excel, describe" on
> >each, putting the contents returned in r() into a data set that accumulates. I
> >open up Stata and run the script, and it works as intended with 14 error 603s,
> >which I catch and handle. (So you don't have to look it up, error 603 means the
> >file could not be opened even though it was found. I don't know why these error
> >603's occur since Excel opens the file just fine, but I'm comfortable with a 1%
> >error rate.) During the debugging process, I've had to run the script
> >repeatedly in a given instance of Stata. After three to five runs, the number
> >of error 603's I get goes from 14 to a couple hundred....
>
> This is a bug in -import excel-.  It will be fixed in the next executable
> update.
>
> -import excel- was not cleaning up file-handle bookkeeping if the
> command exited when trying to open a workbook.  -import excel- has a
> maximum of 50 open workbooks at one time.  Because of the bug, Stata
> could not open any more workbooks after 50 errors because it thought
> there were 50 open file handles.  This would cause Stata to error every
> time you tried to open a workbook.  Until we release the update, the
> open workbook counter may be reset by re-starting Stata.
>
>
> -Kevin Crow
>  kcrow@stata.com
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index