Announcement

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

  • Run do files inside a do file

    Hello,

    I have different do files in a folder (let's call dofile1.do, dofile2.do and dofile3.do). I am creating a new do file (let's call DEF.do) in which I would like to run the do files and different codes that I am doing. Is it possible to do it? To run the do files I am trying the following command:

    Code:
    do "$dofile1.do"
    
    "$C:\Users\ogeid\Desktop\Master Thesis UCLouvain\ACLED\Proofs\dofile1.do"
    where C:\Users\ogeid\Desktop\Master Thesis UCLouvain\ACLED\Proofs is the path where dofile1.do is (the same path where I am running the do file DEF.do.

    Both of them give me an error. The first one code says "file .do not found" and the second code says "file :\Users\ogeid\Desktop\Master Thesis UCLouvain\ACLED\Proofs\my_spatial_2sls.do not found"

    Best,

    Diego

  • #2
    The $ means that you are trying to access a global macro. That is the cause of the errors. Just remove those.

    Code:
    cd "C:\Users\ogeid\Desktop\Master Thesis UCLouvain\ACLED\Proofs\"
    do dofile1.do
    do dofile2.do
    etc
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you Maarten Buis ! It works!.

      Comment

      Working...
      X