Announcement

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

  • Master do-File in a Project

    I have a "project" folder that contains following subfolders:
    • data
    • log
    • orig
    • prog
    In the prog, there are the do-files, including master, profile, "md04_mergebhp.do" and other do files.
    The profile.do is there to show the path and includes the following commands:
    *** DEFINE PATH GLOBALS ***
    global orig "R:\Projekt mit Sam\ffp2491\orig"
    global data "R:\Projekt mit Sam\ffp2491\data"
    global prog "R:\Projekt mit Sam\ffpz2491\prog"
    global log "R:\Projekt mit Sam\ffp2491\log"


    I have already prepared the "md04_mergebhp.do" and runs smoothly on its own.
    The problem is with the Master do-file, in which the following commands exist:
    do $prog/md04_mergebhp.do
    clear
    set more off

    when I run it, this error appears
    . do $prog/md04_mergebhp.do
    file R:\Projekt.do not found
    r(601);

    I am new to stata and don#t know what mistake am I doing there? or where should I read to learn working which such a project.
    I appreciate if anyone can give me a hint.

    Last edited by Maahdi Gholamii; 11 Mar 2022, 05:22.

  • #2
    The quotation marks you included around your path in your global command serve to create the global macro, but are removed from it when it is stored. Since your path has spaces in it, you need to surround it with quotation marks on the do command.

    Code:
    do "$prog/md04_mergebhp.do"

    Comment


    • #3
      Dear William,

      Thank you for the hint, If asked earlier, it could save me some hours. Great that such a forum exists!

      Comment


      • #4
        What i do, for what it's worth, is I'll do something like "do 2_Population" if I'm collecting and cleaning population data.

        Comment

        Working...
        X