Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • too many wildcards in newname

    foreach v of varlist _stat_14 - _stat_5956 {
    2. local x : variable label `v'
    3. rename `v' `x'
    4. }
    too many wildcards in newname
    You requested _stat_14 be renamed _b[11105b.ind_code]. There are more wildcards in new than in old. Wildcards in old and new correspond one-to-one from left-to-right
    unless you specify explicit subscripts in new. Anyway, rename ran out of wildcards in old when matching the wildcards in new. Perhaps you just made a mistake or perhaps you
    forgot an explicit subscript in new. Or perhaps you forgot to specify option addnumber, which allows you to specify an extra #, (#), (##), ...



    I want to replace a variable name with variable label, but getting this error.

  • #2
    Many variable labels are unsuitable (indeed illegal) as variable names. That is my guess at the real problem here.

    Code:
    local x = strtoname("`: var label `v''")

    Comment

    Working...
    X