Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: efficient file organization for programming

From   Maarten buis <>
To   stata list <>
Subject   st: efficient file organization for programming
Date   Thu, 18 Mar 2010 15:50:05 +0000 (GMT)

I have had the pleasure recently of collaborating with someone who 
was new to programming in Stata. This experience made me remember 
that it took me quite a bit of trial and error before I got system 
of organizing my files that worked for me. So I thought I write 
this up, in the hope that it might be helpful to somebody.

Two issues stumped me for quite a while:

1) I don't want the version I am currently working to be my 
default. It takes a while before I get all the bugs out, and till 
that time I want the older version to be my default

2) I want to keep older versions in case an "improvement" in a newer 
version turned out to be no improvement at all. However, till I need 
them, they should be unobtrusive.

The solution was remarkably simple, and has to do with the priority 
which Stata gives to .ado files stored in different locations. In 
particular, if you use -cd- to change the current directory to a 
directory that contains an .ado file, than that .ado file will take 

So I have a folder called Stata which contains all my Stata programs. 
Within that folder, each program has its own folder, and within a
program's folder each version has its own folder. If I want to update 
a program, I start by creating a new folder for the new version, copy 
the latest version to it, and start working. While working on it, I 
will test it in a .do file that first -cd-s to that directory. 
However, if I need to switch to "real work" before finishing it, the 
default will still be the version I downloaded from SSC. 

This solved my two probels, because for me, the "official version" of 
my programs are the ones I submitted to SSC, and I use version numbers 
for the folder names of the different version, so I can easily find the
current version: it is the bottom one, and Stata won't get confussed 
with these older versions hanging around on my system (unless I 
explicitly -cd- to that directory).

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index