Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: sysdir set for do-files or datasets ?

From   Ulrich Kohler <>
Subject   Re: st: sysdir set for do-files or datasets ?
Date   Thu, 18 Dec 2003 10:19:07 +0100

Misha Bonch-O wrote:
> With sysdir set, we can specify a personal  directory for ado-files,
> where Stata will look them up first.
> Is it possible to do the same for do-files ?  Or for the datasets ?
> I prefer to keep my datasets and do-files that I run in the different
> directories.
> Therefore, if my current working directory is the one with the datasets,
> I always have to write a very long path to: do "longpath"
> Other way, of course, is to set current directory with do-files, but I
> will have to  write long path names when I use or save datasets.
> Is there way to set up a default directory, where Stata starts looking
> for do-files or datasets ?
> Thank you, for attention.
> Misha Bonch-Osmolovski.
> UNC-Chapel Hill.

One way is to define global macros in your "". If you have commands 
global em "M:/group/mygroup/myunit/ourdata/mydata/em"
global projdo "M:/group/mygroup/myunit/ourproject/mydofiles/"

in "" you can use commands like

. dir $em/*.dta
. describe using $em/mydata
. do $projdo/

in your do files and interactively. 

See -help profile- for a describtion of

Another way is the package -fastcd- by Nick Winter, which can be installed 

. ssc install fastcd

from the Boston-Archive.

Many regards

+49 (030) 25491-361

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index