Data editing > Creating new variables > Naming variables
 
Naming variables
All variables in a program must have a unique name, which can be up to 253 characters long. The name must not contain spaces and must start with a letter.
You can use only the following characters in a name:
letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
underscore: _
digits: 1234567890
You can choose any name you like, but you are advised to use names which have some relevance to the type of data they contain: for example, total_income for a variable which contains a respondent’s total income.
Also, remember that Quantum is case insensitive and therefore does not distinguish between uppercase and lowercase letters. For example, COUNTRIES_Visited is the same as Countries_Visited.
Although variable names can include digits, if you do include a digit and you are using the s option, you still have to refer to the individual columns using parentheses. For example, if you create a data variable by writing:
data safe 15s
you can refer to column 12 of this variable by writing:
safe12
However, if you create a data variable whose name ends with a number by writing:
data safe1 15s
Quantum does not recognize safe112 as column 12 of the data. So you have to write:
safe1(12)
which defeats the purpose of using the s flag.
So, to avoid unexpected conflict statements during a Quantum run, it is simpler to name the variables using only A through Z and the underscore characters.
See also
Creating new variables