Announcement

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

  • Can I tell Stata where to store tempfiles?

    Dear all,

    the question I have is nothing more than that told in the title. I am currently working on a workstation of the National Statistical Office where I cannot write on C:/. Therefore, everytime Stata tries to access C:/ there are some problems. Can instruct the program to store -tempfile-s soewhere else?

    Riccardo

  • #2
    Riccardo,

    See http://www.stata.com/support/faqs/data-management/statatmp-environment-variable/.

    Regards,
    Joe

    Comment


    • #3
      Thank you Joe! I will look into that. Riccardo

      Comment


      • #4
        I just read the document Joe suggested but for some reason it didn't work. I coded


        Code:
        set STATATMP=H:\temp

        (I also tried to enclose the path within quotes). But Stata replied with

        Code:
        set STATATMP not allowed; ' STATATMP' not recognized
        r(199);
        Note that I am working on a workstation on which I have limited rights. For instance, I cannot set the maximum amount of memory used by Stata. Can this be connected to the problem I am experiencing now or rather this is more likely to be my mistake?

        Many thanks!
        Riccardo

        Comment


        • #5
          The set here is an operating system command, not a Stata command.

          Comment


          • #6
            Thank you Nick. I see. So, I should ask the system administrator to do that for me.

            Comment


            • #7
              Depends: you should able to access a command prompt, but I can't tell you what you don't know about your own set-up.

              Comment


              • #8
                Riccardo,

                Try the shell command in Stata. If that doesn't work you might be able to change the environment variables by doing right-clicking on Computer -> Properties -> Advanced System Settings -> Environment Variables. (This is for Windows 7, may be slightly different for earlier or later versions.) I actually found that this method worked better than using the command line.

                Regards,
                Joe

                Comment


                • #9
                  Using shell you set the variable for the current session only. Using the dialog you set the variable persistently. One or another may be 'better' in a particular case.
                  Necessity of admin rights is also discussed here: see Microsoft's doc.
                  Best, Sergiy

                  Comment


                  • #10

                    This works for me. It should be a line in your profile.do:

                    global TMP = "e:\TMP"

                    Comment


                    • #11
                      Thank you all. Nothing worked unfortunately because on this workstation I can only access one partition - which is not C:\ unfortunately. I notified the problem to my system administrator.

                      Comment


                      • #12
                        I would hope you have access to some sort of drive you can write to. Otherwise, how do you save anything, e.g. A Word document you have written? I suspect you just aren't using the right drives or folders. You might see if any of the advice in this document can be adapted to your purposes: http://www3.nd.edu/~rwilliam/statsin...a/ndstata.html
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        StataNow Version: 19.5 MP (2 processor)

                        EMAIL: [email protected]
                        WWW: https://www3.nd.edu/~rwilliam

                        Comment


                        • #13
                          Originally posted by riccardovalboni View Post
                          Thank you all. Nothing worked unfortunately because on this workstation I can only access one partition - which is not C:\ unfortunately. I notified the problem to my system administrator.
                          In this case it is likely that ALL the users of the system are having the same problem. In that case Stata is just not functional on that system, and it is a definitely a ticket to the administrator.

                          Best, Sergiy.

                          Comment


                          • #14
                            Originally posted by Richard Williams View Post
                            I would hope you have access to some sort of drive you can write to. Otherwise, how do you save anything, e.g. A Word document you have written? I suspect you just aren't using the right drives or folders. You might see if any of the advice in this document can be adapted to your purposes: http://www3.nd.edu/~rwilliam/statsin...a/ndstata.html

                            Thanks a lot Richard. Tomorrow, I will try your mystata.do. Yes, I can write on the partition to which I have access. Basically, I have reading rights to some data folders and reading and writing rights to one specific partition. In this way, I can copy data in my partition and work on it. However, Stata cannot connect to the internet and I cannot view the C:\ folder to modify files such as profile.do. Every time I need a package I have to contact the system administrator who stores it in a directory that Stata can read (he modified the profile.do accordingly). Do you think one of the first three lines of your mystata.do will tell Stata to save

                            In this case it is likely that ALL the users of the system are having the same problem. In that case Stata is just not functional on that system, and it is a definitely a ticket to the administrator.

                            Best, Sergiy.
                            Yes, I agree with you Sergiy. These working conditions slow you down and make you lose the desire to experiment.
                            Last edited by Riccardo Valboni; 27 Jun 2014, 14:42.

                            Comment


                            • #15
                              For people who don't want to bother reading through everything on my page, the key idea is that you create a file called mystata.do that is located on a network drive you have read/write access to, e.g. N:. Then, when you start Stata you give a command like

                              run N:\mystata

                              mystata.do has lines like

                              Code:
                              * These commands personalize your Stata directories.
                              * You need to create these directories first.
                              sysdir set OLDPLACE N:\ado
                              sysdir set PERSONAL N:\ado\personal
                              sysdir set PLUS N:\ado\plus
                              I think this would solve some of the problems Riccardo says he has, e.g. can't download packages himself. (Although if he doesn't have internet access I guess he'll still have to find some way to get the files downloaded.)

                              However I don't understand the problems Riccardo initially reported. If Stata can't write temporary files somewhere then how does it run at all? The people with the superhuman powers over the machine need to be consulted.
                              -------------------------------------------
                              Richard Williams, Notre Dame Dept of Sociology
                              StataNow Version: 19.5 MP (2 processor)

                              EMAIL: [email protected]
                              WWW: https://www3.nd.edu/~rwilliam

                              Comment

                              Working...
                              X