Hi,
I am writing a program that creates some additional variables in the data set. I would like to provide an option in this program to save the data set with those additional variables.
I would like to do several things:
1. Provide an option to save the data set
2. Allow the user to specify a name for the data set
3. Allow the program to replace the data set (in case the user runs the program more than once).
Ideally, the program would look something like:
syntax varlist(min=3), [savedata(string)]
A toy program could be:
I would like to save the data set that also now contains these three newly generated variables.
Any help is much appreciated.
I am writing a program that creates some additional variables in the data set. I would like to provide an option in this program to save the data set with those additional variables.
I would like to do several things:
1. Provide an option to save the data set
2. Allow the user to specify a name for the data set
3. Allow the program to replace the data set (in case the user runs the program more than once).
Ideally, the program would look something like:
syntax varlist(min=3), [savedata(string)]
A toy program could be:
Code:
program define test, rclass syntax , [savedata(string)] sysuse auto, clear gen mpg2 = mpg2 gen turn2 = turn gen price2=price
I would like to save the data set that also now contains these three newly generated variables.
Any help is much appreciated.
Comment