I find that
Code:
foreach x in  Gold Platinum_upgrade Platinum_upgrade_merit {
in fact, there is no Gold variable in the dataset. Instead, this is Gold_benefits variable. It seems in the list in foreach, variable name can be truncated. Is my understanding correct?

Another problem is that I cannot run foreach loop in the do file. It always prompts "invalid syntax
r(198);
"

Many thanks in advance!