Dear all,
I would like to create a new file using the postfile command but the
number of variables in the output file is not constant. More
specifically, my program might look like that:
local variable_list "var1 var2 var3"
local no_var: word count `variable_list'
postfile postname `variable_list' using filename, replace
forvalues i=1(1)`no_var'{
local var`i'=`i'
}
post postname (`var1') (`var2') (`var3')
postclose postname
My problem is that the variable_list macro does not have a constant
number of elements. Do you know how I can write the post postname
command to take this into account?
Thank you very much fo any help.
Best wishes
Eve Corda
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/