Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Files, Directories and Macros


From   Andrés Castañeda <r.andres.castaneda@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Files, Directories and Macros
Date   Tue, 31 Jan 2012 11:29:47 -0500

Dear Maartin,

It didn't work. I got the following error:

use "$dir/`data'", clear
invalid 'example.dta'


Thanks,

On Tue, Jan 31, 2012 at 10:16 AM, Maarten Buis <maartenlbuis@gmail.com> wrote:
> 2012/1/31 Andrés Castañeda :
>> I have a problem using macros to organize files. Let’s say that in the
>> folder "C:\Temp" I have a UNIQUE dta file named “example.dta”. I need
>> to call this file in Stata by using macros.
> <snip>
>>  use "$dir\"`data', clear
>> invalid '"example.dta'
>
> See: Nicholas J Cox (2008) Stata tip 65: Beware the backstabbing
> backslash. The Stata Journal, 8(3): 446-447.
> <http://www.stata-journal.com/article.html?article=pr0042>
>
> In short, the answer is:
> use "$dir/`data'", clear
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
>
> http://www.maartenbuis.nl
> --------------------------
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/



-- 
___

Best,


Andrés Castañeda
World Bank, LAC-PREM
Research Associate
acastanedaa@worldbank.org
Tel 1(202) 677 - 8971
1850 I st, NW, Washington, DC.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index