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

Re: st: RE: Running do files from other folders?

From   Steven Samuels <>
Subject   Re: st: RE: Running do files from other folders?
Date   Thu, 6 Nov 2008 18:51:15 -0500

Robert has the choice of creating a "calling" do file in his current directory instead of typing commands by hand. That is what I would do. Macros can save much of the typing:

local survey = "~/Documents/Curr_Proj/Survey/"     //Study Directory
local p1 "`survey'PBatch1/"                        //1st subdirectory
local p2 "`survey'PBatch2/"                        //2nd subdirectory
local p3 "`survey'PBatch3/"                        //3rd
do `p1'p05


On Nov 6, 2008, at 5:22 PM, Martin Weiss wrote:

Perfectly possible: Just specify

do "C:\Users\Martin\Desktop\"

and possibly append arguments after the closing quotation mark...


-----Original Message-----
[] On Behalf Of Ploutz- Snyder,
Robert (JSC-SK)[USRA]
Sent: Thursday, November 06, 2008 11:05 PM
Subject: st: Running do files from other folders?


Newbie question:

Is it possible to run do files that is located in a different directory
from which you are working?

For example, if I am working in a folder called
D:\StataData\ThisProject, and I want to call a do file from a different
folder, like say D:\StataData\ThatProject, is this possible?

I have similar needs for calling do files in main directories from
within sub-directories. I'd like to save all of my various do files in
a primary folder (D:\StatData ) but then have the ability to call them
from any other sub-directory..or possibly from folders on different
drives or otherwise NOT within the parent directory.

Seems like you should be able to do something like:

Run D:\BlahBlahDirectory\NiftyDoFile Arg1 Arg2 Arg3


*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

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