Dear members of the Statalist community,

I am a grad student with experience in R, currently working on Stata for a RAship. Hence I am a beginner on this plateform but eager to learn.
I have encountered a problem with my own dataset, that the following example illustrates well.

Suppose I want to convert variables in inches to centimeters in the auto dataset. I could do this which gets me the result I want.
Code:
sysuse auto, clear

foreach var of varlist headroom length{
gen `var'_cm = `var'*2.54
}
Now this approach poses two problems: The list of variables I am using in the loop is very long and prone to change. Furthermore, this syntax does not really allows to grasp what headroom and length have in common.
A local macro seems appropriate to solve for that and make the code more self-documented.

I have tried the following code, which can be executed without Stata throwing an error, yet without coming near the expected result.

Code:
sysuse auto, clear

local vars_inch headroom length

foreach var of local vars_inch {
gen `var'_cm = `var'*2.54
}
In fact, nothing is happening on my dataset and the two variables in centimeters are not generated.

This is eventually a basic syntax issue, I would be very thankful if someone could point me out to the correct syntax.

Best,
Axel