This rings a very faint bell, but no precise command name
springs to mind.
Nick
[email protected]
Phil Schumm
> On Jan 7, 2007, at 12:09 PM, Nick Cox wrote:
> > This particular problem can be avoided by using -capture-
> as a prefix.
> >
> > capture ren `var' `=`var'[1]'
> >
> > will eat the error if the first value is not a valid new variable
> > name. Alternatively you could use -confirm- directly.
>
>
> Thanks for pointing that out -- I should have written the example
> that way. Production code would of course need this even with a
> function to generate Stata names, to account for the possibility of
> duplicate names (either because of duplicate names in the data file
> or because a name in the file clashes with one of the
> automatic names
> Stata generates when -nonames- is used (i.e., v1, v2, ...)).
>
> I gather from your response that you are unaware of an exposed
> function to generate Stata names from an existing string?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/