Cornell University Cornell University CISER

CISER Computing

Installing user written ado files on the research servers

Q1:  When I try to download and install user written programs I get an “access denied” message. How can I use these?

Q2:  I am running Stata on a research server and I'm interested in using some commands that are not part of the main software. These commands are written by users and available to be installed into Stata through the web. The Stata reference manual makes this sound straightforward, but when I go through the steps on a research server, I can't install the new command because I don't have permission to add files to the space where the Stata code is kept on the server. How do I get around this?

ANSWER:

It's true that research server users do not have permissions to write to the default path for STB and other user-written files. If you feel confident that the files you wish to download are supported by Stata and will be useful for other users, you may send a request to ciser@cornell.edu to have them installed by a system administrator so that they are available for all users.  *Otherwise*, all you need to do is to put the files into a directory to which you do have permission (i.e. somewhere in your own home directory on the U:\ drive) and then reset the path which Stata uses to search for these files.

First, from within Stata you can issue the command "sysdir" to see the list of the system set directories, to which Stata points to by default.  Included in the list of default settings are these entries:

PLUS: C:\ado\plus    
PERSONAL: C:\ado\personal

Note that the PLUS folder is the destination for downloaded ado files.  The PERSONAL folder is intended for ado files written by the user.  CISER Research Computing users do not have permission to write to the C:\ drive so there are several options:  For commonly used, Stata supported, downloadable ado files -- users may also request that CISER staff install those on the C:\ drive.  If you need to use an ado file during off hours you can install it yourself by redirecting the PLUS folder to your home directory (as shown below).   To install user written ado files (anytime) you'll need to use  the "sysdir set" commands (case is important) to redirect the PERSONAL folder as shown below:

sysdir set PLUS "U:\folder"
sysdir set PERSONAL "U:\folder"


where "folder" is the subfolder you wish to save your ado files in (you must create this first).

examples: 

sysdir set PLUS "U:\stata\plus"
sysdir set PERSONAL "U:\stata\personal"


Now if you issue the command "sysdir" you will see your custom settings:

PLUS: U:\stata\plus
PERSONAL: U:\stata\personal


***********************************************

To make this a "permanent" change do this:

Create a shortcut to the Stata application on your desktop (Start → All Programsright-click on Stata10 → choose "send to" → Desktop).  Then find the newly created shortcut on your desktop, right click on the icon and choose "properties".  In the "Start In" field enter the path "U:\My Documents".  Use the Stata do file editor to create a file called "profile.do" file which contains the sysdir commands you wish to use.  Be sure to place the profile.do file in the directory "U:\My Documents".  Stata will automatically look for the profile.do file when opening and run those commands.