[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Rename problem: r(110) already defined

From   Richard Williams <>
Subject   Re: st: Rename problem: r(110) already defined
Date   Tue, 12 Feb 2008 18:14:46 -0500

At 05:53 PM 2/12/2008, Friedrich Huebler wrote:
I am trying to convert all variable names in my data to lowercase,
using the commands below. The -rename- command returns error code 110
"already defined" if a variable name is already lowercase.

local vars "`r(varlist)'"
foreach v of local vars {
  local newname = lower("`v'")
  rename `v' `newname'
How about changing the rename command to

if "`v'" != "`newname'" rename `v' `newname'

You might also consider the Weesie and Cox -renvars- command, which is dm88_1 from the Stata Journal.

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index