Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Stata 12 bug report: -rename- with wild card (*) used in do-file

From   daniel klein <>
Subject   Re: st: Stata 12 bug report: -rename- with wild card (*) used in do-file
Date   Wed, 8 Aug 2012 17:33:07 +0200


can you show exactly what your do-file code looks like, or even better
show an example, replicating the problem?

This works in interactive mode, as well as in a do-file for me

forv j = 1/10 {
    g foo_bar`j' = .

ren (*_*) (*1_*)

Omitting parentheses is not a problem either. I am using Stata 12 on a
WinXP machine.


Hey folks

I was planning to use -renpfix- to change a series of variable
prefixes in my data file but noted that users are pointed toward using
-rename- instead. Fine .. Now, the issue is that I found that the
following command does the desired renames if I execute it
interactively in Stata 12, but not when I include it in a do-file:

rename *_* *1_*
The error message suggests the wild card * is an invalid name"=.
Am I missing something?
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index