[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Master do file- error
On 6/14/07, Carola Weiss <firstname.lastname@example.org> wrote:
I would like to create a master do file. But my problem ist that if I type all my do files I get the error message "file not found". I donīt know whatīs wrong. Is it possible that my do files arenīt allowed to refer to another do file? e.g:: do file 2 refers to do file 1?
Without seeing your directory structure and what you've typed its
impossible to diagnose, but a good guess would be that your do-files
are in a different directory from the one that Stata is in when you
try to call them from your master-do file.
An example of the directory structure (and some of the do-files) of
one of my work folders is given below....
| |-- clean
| |-- ped
| |-- raw
| | |-- bcap
| | |-- bid
| | | `-- pedgenie
| | |-- hapmap
| | |-- snphap
| | `-- unphased
| |-- stata
| | `-- res
| `-- txt
| `-- qc
| |-- bid_analysis.do
| |-- bid_master.do
| |-- bid_prep.do
As you can see I have three do-files that reside in the sub-directory
scripts. I will start Stata and -cd- to the directory the highest
level of this directory (in this instance all of the above are
contained in a folder caller 'prostate').
I can then call the 'bid_master.do' file by typing -do
scripts/bid_master.do'. This simply calls the other two do-files, but
refers to them as being in the directory scripts/ ....
$ more scripts/bid_master.do
If Stata is saying 'file not found' then it means exactly that, you
are "asking" Stata to do something with a file that does not exist in
the location you have typed. Check these, and be wary of any -cd-
commands in your scripts as Stata will then be in a different
directory and the relative paths will not exist.
An alternative is to always use absolute paths. A caveat to this is
that if your path contains spaces then you should enclose it in
"In mathematics you don't understand things. You just get used to
them." - Johann von Neumann
Email - email@example.com / firstname.lastname@example.org
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/
* For searches and help try: