Hi,
I want to read a data set into stata do a few steps on it and save it again with the same name. (actually I want to do the same on several data sets using a foreach loop, but that is not important or the problem that I am facing - so not bringing that issue here).
The following code works fine [Windows 7, SP1, 4gb memory]
This saves/replaces the data set x.dta in the working directory. But I am facing the problem when I am trying to use a sub directory within the working directory with the following code. The name of the sub directory is 'data' and it is directly within the working directory.
What is happening is the last save command is saving a new dataset with the name ".dta", (while I want it to just replace "x.dta"). Is there anyway to solve this problem without specifying the filename in the last save command?
Thank you.
I want to read a data set into stata do a few steps on it and save it again with the same name. (actually I want to do the same on several data sets using a foreach loop, but that is not important or the problem that I am facing - so not bringing that issue here).
The following code works fine [Windows 7, SP1, 4gb memory]
Code:
version 12.1 drop _all set obs 10 gen x=1 save x, replace //upto this is just to create the example dataset use x, clear gen y=2 save, replace
Code:
version 12.1 drop _all set obs 10 gen x=1 save data/x, replace //upto this is just to create the example dataset use data/x, clear gen y=2 save data/, replace
Thank you.
Comment