Announcement

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

  • A possible bug: Stata repeats three characters from command and reports an error

    Dear Statalisters,

    when executing my do-files, Stata has sometimes made mistakes in reading commands. For instance, this morning, I ran a do-file that contained the line
    Code:
    label define ...
    Running the do-file was unsuccessful; the log informed me that Stata had turned the line into
    Code:
    label bel define ...
    which of course yielded a syntax error. I re-ran the file, and it executed just fine.

    This has happened to me on several occasions, with different do-files and different commands. The one thing all these errors have had in common is that Stata repeated the last three letters of a word (if I recall correctly, not always the command; it could also affect, e.g., a variable name or an option). This would usually result in a syntax error, an unknown variable error or the like.

    The error was never reproducible and disappeared the next time I executed the file. Therefore, this is more an annoyance than a serious problem. I was wondering, though, if anyone has had a similar issue?

    Not sure if any of this matters, but I'm using Stata 13 on a linux machine, which I am accessing remotely. The do-file was executed in batch mode.

  • #2
    FWIW, I had a vaguely similar problem a few years back, with Stata "stuttering" commands that I typed into the command window when using it remotely. (Execution of do-files, however, was not affected.) The nature of the stuttering was different from what you describe. And it turned out not to be a Stata problem; it had to do with my remote connection settings.

    Comment


    • #3
      By any chance were you editing the do-file in question in an external editor at the same time Stata was executing it? Doing so can cause exactly the problem described.

      Comment


      • #4
        Alan, thank you for your quick response. That could indeed have been the reason. The do-file in question takes some time to run, so I often continue to do work while it runs in the background. Out of curiosity, do I take your response to mean that this is a problem with external editors only? That is, if I run a do-file and meanwhile edit it with Stata's built-in editor, I'll be fine?

        Comment


        • #5
          Originally posted by Jasper_Haller View Post
          Alan, thank you for your quick response. That could indeed have been the reason. The do-file in question takes some time to run, so I often continue to do work while it runs in the background. Out of curiosity, do I take your response to mean that this is a problem with external editors only? That is, if I run a do-file and meanwhile edit it with Stata's built-in editor, I'll be fine?
          When you use Stata's Do-file Editor and execute (do) a file from within it, it saves the file to a temporary file and then executes the temporary file. It does so just to avoid this sort of problem.

          By the way, this is an operating system thing, not a Stata thing. The same problem will arise if you are executing a shell script and edit/save it while it is being executed.

          Comment


          • #6
            Thanks for clearing that up!

            Comment

            Working...
            X