Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error message: I/O error writing .dta file

    Hello everyone,

    I've been using stata for sometime now and since some days ago I've started getting this error message:

    Code:
    I/O error writing .dta file
        Usually such I/O errors are caused by the disk or file system being full.
    r(693)
    I thought it was a specific problem with the code since it was the first time I've used the command outreg2, but now nothing seems to work. Do files I used months ago that were working perfectly fine give me the exact error message when merging or saving results in excel.

    I've found people with similar problems (https://www.statalist.org/forums/for...iting-dta-file) but after trying everything I could think of I still haven't figured it out.

    Kind regards,
    Blanca

  • #2
    It suggests that your disk or file system is indeed full. From the topic you linked to, did you follow the further link to the Stata Temporary Files FAQ, which explains how Stata temporary files can be left to take up space if Stata crashes, and how to go about deleting them manually.

    https://www.stata.com/statalist/arch.../msg00542.html

    Comment


    • #3
      I would try manually saving some small data file to the directory to which you have directed -outreg2- to save and see what (if any) error message comes from that. (And, an afterthought: I can't think of any reason to use -outreg2- to save a *.dta file, so I wonder if there is some other confusion going on here. -outreg2- is meant to save files of output for word processing of result tables.)
      Last edited by Mike Lacy; 27 Jan 2020, 16:44.

      Comment


      • #4
        Thanks for your comments guys, unfortunately I'm still unable to fix the problem.

        William, I did delete all the temporary files and checked that I had enough space in my drive, but the error still appears.

        Mike, I think I didn't explain myself correctly. My problem is that I get the same error message for different things like using outreg2 to save regression tables on excel or latex format, or using merge to add a new variable.
        Here are some (very simple) examples of the codes that used to work but now give me the same error:
        Code:
            xtdpdsys invent L.cash_ta L.dsales L.debtta, lags(1) artests(2)
            outreg2 using ${dirreg}Inv_L.invnet_1_1_bover_EU.xls, stats(coef)
        Code:
            cap drop _merge
             merge m:1 year countryisocode using "G:\merge.dta"
        Last edited by Blanca Rivera; 28 Jan 2020, 02:41.

        Comment


        • #5
          These problems are unfortunately almost impossible to solve in a forum once the "obvious" answers have been tried and rejected. I would try your local IT support or StataCorp technical services. See e.g. https://www.stata.com/support/faqs/t...-tech-support/

          Comment


          • #6
            Hello Nick, thanks I think I will do that and hope for the best.

            Comment


            • #7
              Blanca Rivera I would recommend you take a look of your Stata temp file directory, to locate the Stata temp file directory, do the following

              Code:
              . tempfile f
              
              . di "`f'"
              C:\Users\hpeng\AppData\Local\Temp\ST_47a8_000001.tmp
              On my system, the temp directory is C:\Users\hpeng\AppData\Local\Temp\ and it will be different on your system. Go to that directory and see how full it is. If it has many leftover files, manually delete all of them, then try your commands again. If the problem persists, contact tech support [email protected].

              Comment


              • #8
                Hi everyone,

                I was able to fix the problem by running the same code with a smaller dta file (using just 5-10 variables and around 1000 observations) and then re-running it again with the original dta file. No idea how this actually worked but it did.

                Hua Peng (StataCorp) I did look at the temporary files and deleted them but that didn't work (they were 10-20 KB), but it is the first thing i thought was the problem as well.

                Thank you all for your help!

                Comment


                • #9
                  Hello everyone,

                  I encountered a similar error and successfully addressed it based on the preceding conversation. It appears that Stata requires an amount of free space equal to or greater than the size of the .dta file in the computer location where Stata is installed. In my case, I was attempting to execute an 80GB .dta file. Although there was ample space on the disk (e.g., local disk E) where the .dta file was situated, there wasn't sufficient 80GB space in the location where Stata was installed (e.g., local disk C). The issues were resolved after I freed up 80GB of space on local disk C.

                  Thanks to all of you for your assistance.

                  Comment

                  Working...
                  X