I am writing an ado command to expand merge capabilities. As such, I have a using dataset as an input to my program. I essentially want to drop a variable from the master dataset that will be added to the master dataset later from using. However, that variable is not in the master dataset so I cannot add it as a varname to the syntax.
To get around this problem, I want to convert a string to a varlist or a varname. Here's an example of something that I would like to do:
How can I do this? Additionally, how do I expand this to a varlist instead of just a varname?
To get around this problem, I want to convert a string to a varlist or a varname. Here's an example of something that I would like to do:
Code:
* load in auto dataset sysuse auto, clear * save local string variable with the same "name" as an actual varname local my_string = “mpg” di “`my_string’” * keep using the actual varname keep if mpg < 20 * what I want to be able to do (where `my_string' parses to mpg, same as above) keep if `my_string’ < 15
Comment