Search code examples
stata

DO File export Command


I was wondering if there was a way in which I could export the data I create in Stata do file to the Stata file format of .dta. I'm using the following code to create the dataset.

use data1, clear
foreach num of numlist 2/30 {
    append using data`num'
} 

Solution

  • In order to specify a name and working directory as part of your Stata Do-File, save "C:\Users\user\Desktop\name.dta"should do the job.