Announcement

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

  • Do File Error - Incomplete Command Execution

    Hi All

    I am using Stata 13 (on a MacBook MacOS Catalina), I have an error in executing commands from my Do File. The command panel doesn't recognize the first few starting letters in the command. This varies from time to time, sometimes it cuts off 3 letters and can be as high as 6-7 letters of the command. When I copy the command from the Do File and execute it on the command panel it runs perfectly fine. Does anyone have an idea why I get this error in my Do File or how I can solve the problem?

    The example is below

    Output from Do File
    ach var of varlist country3 {
    unrecognized command: ach
    r(199);

    end of do-file

    r(199);

    Command in Do File
    foreach var of varlist country3 {

  • #2
    Welcome to Stata list. You will increase your chances of useful answer by following the FAQ on asking questions-provide Stata code in code delimiters, readable Stata output, and sample data using dataex.



    I have not heard of this problem. I would be more confident that it is not a problem in your coding if you had used code delimiters and copied the code. Also, provide enough that we can run your code easily. The chances are you've done something strange. Are you using the do file editor that comes with Stata or are you using some other editor? It is possible if you're using some other editor that the editor has done something odd. What is in the code before the for each statement?

    If using the do file editor doesn't fix it, I suggest you contact Stata technical support.

    Comment


    • #3
      Thanks Phil for your response.
      I am using the Stata Do File editor. I have written all my codes in the same editor, however, I encounter the above problem which is very annoying. I practically cannot run any codes in my editor.
      I provided the above as an example, that error happens regularly for any code I am running from the Do File Editor, so I practically have to copy the codes from the editor into the command window to execute them.

      Comment

      Working...
      X