Hi everybody,
I'm trying to replace an existing variable label with a subtract of the existing varlabel (first nine characters) within a Stata loop:
my code looks like this:
foreach var of varlist _all {
local varlabel: var label `var'
local newname: substr(`varlabel',1,9)
label `var' `newname'
}
Then I receive the following error:
substr not allowed ??
Hope you can help
Kind regards Frank
0 Response to substr existing variable label and replace existing varlabel?
Post a Comment