Announcement

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

  • A strange problem with the "save" command

    Dear Users,

    I am relatively new to the world of Stata and expecially to this forum, so please bear with me...

    I use global paths:
    >global data "\\Client\D$\Documents\university\stata\data"

    Then, I create the data set and save:

    >save ${data}/test.dta, replace

    This does not result in an error code, but it does not save the data either. Stata does not return the confirmation "file... saved" which I am used to see after this command.
    By the way, this way of working is required - I cannot opt for something different or save manually. How should I approach this problem?

    Thanks in advance

  • #2
    there is a $ sign in your path, suggesting to Stata that another global macro starts. This global macro is in all likelihood empty, so your file is in all likelihood saved as \\Client\D/test.dta
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you for your reply.
      I have checke the directory you mention, but all I can find are data sets from attempts were I forgot to specifiy the global path, not the test.dta, unfortunately.

      Comment


      • #4
        I can't replicate the issue.
        I tried using an online folder as you are using, and created a folder with a $ just to see what that effect would be.
        doing:
        Code:
        sysuse auto
        global test "\\ID.AAU.DK\Users\jorrit\Downloads\D$\test"
        save ${test}/test.dta, replace
        saves the file just fine, in the expected location, for me:

        Code:
        . sysuse auto
        (1978 Automobile Data)
        
        . global test "\\ID.AAU.DK\Users\jorrit\Downloads\D$\test"
        
        . save ${test}/test.dta, replace
        (note: file \\ID.AAU.DK\Users\jorrit\Downloads\D$\test/test.dta not found)
        file \\ID.AAU.DK\Users\jorrit\Downloads\D$\test/test.dta saved
        
        . 
        end of do-file

        Comment

        Working...
        X