Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Do Files and Arguments

From   Erika Kociolek <>
Subject   st: Do Files and Arguments
Date   Sun, 7 Apr 2013 17:14:36 -0700

Hi all,

My question is related to .do files and passing arguments to them.
Let's say that I have a file called, and the .do file I want
to run from is called

Here's the syntax in the file

local quarter 2
cd C:/Directory/MyDirectory/Q`quarter'_2012/

do routine1

Here is the syntax in the file :

use ../Q`quarter'_2012/mystatafile.dta, clear

I don't want to have to define the local "quarter" in all of the .do
files that I want to call and run in Is there any way to
pass along the quarter argument to files called in the file?

Any resources you can point me to would be very helpful.

Thank you,
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index