Nuno Soares wrote:
> Hi Nick,
>
> I'm also using Stata 9.2. After your email I tried the following;
>
> . use "C:\DATA\qksave\auto.dta", clear
> . Save test
>
> And stata saved the test.dta file in the "c:\data" directory not in the
> "c:\data\qksave" directory. Maybe a default I've changed?
No contradiction to what Nick said. Your "working directory" is "c:\data", not
"c:\data\qksave". The command -use c:\data\qksave\auto- does not change your
working directory. -use- loads the data, that's it. You need -cd- (i.e.
"change directory" to change the working directory.
It is always a good idea to work in the directory in which you store the files
of your project (I call this "project directory"). Basicly this implies
. cd c:\data\qksave
. use auto, clear
. save test, replace
Or, more general:
. cd path/to/my/project/
. do something
BTW: The very nice ado-package -fastcd- from SSC allows you to quickly change
between several project directories.
Uli
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Nick Cox
> Sent: 15 May 2006 22:27
> To: [email protected]
> Subject: st: RE: RE: Quick Saving
>
> I don't know what Stata you are using.
>
> I am using Stata 9.2, in which -save <filename>- saves to the current
> directory or folder unless otherwise specified. I can't remember any other
> behaviour.
>
> Nick
> [email protected]
>
> Alex Ogan
>
> > Is `c(pwd)' what you want?
>
> Nuno Soares
>
> > I was wondering if anyone knows of a procedure that allows the user
> > to save the current dataset in the current working directory without
> > typing the all path, just the filename.
> > If we don't specify the path, the -save- command saves the file in the
> > default data directory. If we want to save in the current working
> > directory (different from the default directory) I believe we have to
> > write the complete path (which is extremely boring if we want to quick
> > save several versions of the file after ).
> > I've been trying to write a ado file that enables to do just that, but
> > I don't know if Stata has a command that retrieves the current
> > directory.
> > The objective is to write a command like this: qksave filename.
> > Can anyone help?
>
> *
> * 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/
>
> *
> * 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/
--
[email protected]
+49 (030) 25491-361
*
* 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/