Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

RE: st: hunting for the source of an error - r(603) - Dual Core problem?

From   "Ben Hoen" <>
To   <>
Subject   RE: st: hunting for the source of an error - r(603) - Dual Core problem?
Date   Mon, 31 Dec 2012 09:43:25 -0500

Thank you David, William, Jeph, Michael & Klaus!

As expected, your insights are spot on.  

Using this link:
and this one:

I was able to change the location of the temp folder, and separately I was
able to add that folder as an exception to my virus protection software.  

The code then ran flawlessly (and only took ~ 2.5 hours vs. the 8 hours I
expected it would take).  

Seems like a win-win.  

Best wishes for the new year, and thank you for all the help.


On Thu, Dec 27, 2012 at 9:46 AM, William Buchanan
<> wrote:
Hi Ben,

How large is the file you're working from? How large are the temp files
you're creating? Do you have many other processes working in the background?
Although I've never encountered the problem I think your intuition about it
being some kind of resource issue might have some merit.

In the meantime, it might be helpful to be more explicit about what you are
hoping to accomplish in the end. Typically, looping over individual
observations is not a great idea, although there are certainly times when it
is a necessary evil.  Maybe with more details about what you are trying to
do other could provide you with suggestions that could make that process
more efficient and avoid creating > 100,000 tempfiles.


Sent from my iPhone

On Dec 27, 2012, at 6:43, "Ben Hoen" <> wrote:

> Hi all,
> I have a relatively simple looping function that repeatedly saves and
> up temp files while looping through each case in a dataset, which, if
> successful, should take ~ 8 hours to run, though, I have yet to have it
> execute properly.  The last four times I have tried to run it will the
> sample I have gotten the same error:
> "file C:\Users\Ben\AppData\Local\Temp\ST_0500000x.tmp could not be opened
> r(603);
> end of do-file
> r(603);"
> where x=3, 4 or 6
> Each time the error has happened on a different case.  The most recent
> occurred on the 794th, 25,835th and the 20,633rd  cases (and before that I
> had runs out to the 70,000 and 60,000th (or so) cases.  There are a total
> 166,181 cases.
> Is it something outside my code that is likely making this occur?  I am
> wondering if this has something to do with a dual-core processor.  I am
> running Windows 7- 64bit, with an Intel Duo Core E8600 - 3.33 Ghz
> with 8 GB of RAM, and am running Stata MP 12.1 for Windows - 64bit.  BUT,
> that is a GUESS (and nothing more).  My thought was that this error is
> occurring when the file is in use or is stored in one processor while the
> other is trying to access it?
> I have tried to force the error by running the code using many different
> subsamples and have never been able to get it to crash, and unfortunately
> breaking the sample down into smaller sample somewhat defeats the purpose
> the code in the first place (which is creating nearest neighbor weights -
> using, in part, geonear(SSC)).  It seems important that the error has
> occurred on a different case, potentially indicating that the problem is
> with the sample.
> Any ideas?  Thank you in advance for any assistance/advice you can offer.
> Ben
> Ben Hoen
> Principal Research Associate
> Lawrence Berkeley National Laboratory
> Office: 845-758-1896
> Cell: 718-812-7589
> Visit our publications at:
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

phone: 845-758-1896
cell: 718-812-7589

*   For searches and help try:

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