Cornell University Cornell University CISER

CISER Computing

Installing STB and user written ado files on the CISER Research Computing System

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

Q2:  I am running Stata on a CISER computing node 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 CISER computing node, 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 node. How do I get around this?

ANSWER:

Its true that CISER computing node 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:\UserX\netid\folder"
sysdir set PERSONAL "U:\UserX\netid\folder"


where “netid” is your own Cornell netid and "folder" is the subfolder you wish to save your ado files in (you must create this first).

examples: 

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


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

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


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

To make this a "permanent" change do this:

Create a shortcut to the Stata application on your desktop (Start --> All Programs --> Stata10 --> right-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 for a chosen location in your home directory.  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 to which your shortcut points.  Stata will automatically look for the profile.do file when opening. and run those commands.