Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: mkdir with local


From   [email protected]
To   [email protected]
Subject   st: mkdir with local
Date   Tue, 18 Sep 2007 20:04:37 -0300 (BRT)

Thank you, Timothy.

The last line does not work and returns an error  [either r(603) or
r(198)depending on how I write the macro ](see below). All rest works
well. Indeed,  the directory is created.



******************* BEGIN: test1.do
local name = "test_directory"
cd C:\
mkdir "`name' "
// my do file
save "C:\`name'\current_data.dta"
******************* END: test1.do

It shows up:

file C:`name'\current_data.dta could not be opened
r(603);

******************* BEGIN: test2.do
local name = "test_directory"
cd C:\
mkdir "`name' "
// my do file
save "C:\"`name'"\current_data.dta"
******************* END: test2.do

It shows up:
invalid 'test_directory'
r(198);




*
*   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/



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