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   Buzz Burhans <wsb2@cornell.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: sysdir set for do-files or datasets ?
Date   Thu, 18 Dec 2003 07:18:34 -0500


I use an ado program by Nicholas Winter called -c- (referred to as fastcd on SSC in the post in this thread by Ulrich Kohler) to speed up changing directories, which is easily done within do files by something like this:

pwd
C:\Documents and Settings\Buzz Burhans\My Documents\Active 6 GlycolStudyWorking9-9-02\NEFA

* suppose I start in the above directory

. c MH

* the results of this command are:

C:\Documents and Settings\Buzz Burhans\My Documents\Active 6 GlycolStudyWorking9-9-02\3MH

* after which I can work in that directory

.save fileX, replace

* and then later change to my original or other directory easily by using -c- again:

. c NEFA

C:\Documents and Settings\Buzz Burhans\My Documents\Active 6 GlycolStudyWorking9-9-02\NEFA


As you can see, typing a short keyword saves a lot of typing in defining the directory.

I am grateful to Nick Winter for making this available, it improves efficiency a lot.

Buzz Burhans



At 08:11 PM 12/17/2003 -0500, you 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"a.do

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.

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
Buzz Burhans
wsb2@cornell.edu


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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