Dear Statalist,
it seems to me that I did not understand the Syntax of "foreach", I typed the code below to produce a panel data set for which I had to rename some variables and added an index(1995,1996,1997,...,2004) as suffix. The loop works perfectly well until it reaches the last variable "kzahl". I do not know why but the last variable is not processed in the loop. Has anyone an idea where I made a mistake?
Thanks for your help,
Johannes
local wave = "l m n o p q r s t u"
local vars = "netto pbleib pbbil01 pbbil02 pbbil03 phrf famstd stell pnat nace psbil hhgr eigen kzahl"
local y = 1995
foreach x in `wave' {
foreach z in `vars' {
rename `x'`z' `z'`y'
}
local y = `y' + 1
}
___________________
Johannes Geyer
Deutsches Institut f�r Wirtschaftsforschung (DIW Berlin)
German Institute for Economic Research
Koenigin-Luise-Stra�e 5
14195 Berlin, Germany
Tel: +49-30-89789-258