Dear all,
I am writing a program which at the beginning I define a varlist:

syntax varlist (min=3 numeric) [if] [in],…….

Then at some point I have:

gen ID=_n

Next, I need to define the value labels for the new variable ID, but I want the value labels to be the name of the variables in the `varlist’. Meaning that I want 1 to be labeled “var1”, 2 to be labeled “var2”, and so on.
Any help would be appreciated.
Noori