Rules for Naming Variables in SPSS

This quick tutorial details the rules for naming variables in the SPSS statistics package.

SPSS allows you to rename variables either via its Variable View or by using syntax. There are a number of rules governing the naming of variables.


Rules & Best Practices for Naming Variables

  1. Names can be safely up to 32 characters long. Names may include alphanumeric characters, non-punctuation characters, and a period (.).
  2. You can’t have a space in a variable name.
  3. Don’t end a variable name with a period.
  4. Don’t end a variable name with an underscore.
  5. You can use periods and underscores within a variable name.
  6. You can use upper and lower case, and a mixture thereof, within a variable name.
  7. You can’t use SPSS reserved keywords as a variable name (i.e., you can’t use ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO or WITH).
  8. Each variable must be unique.


That’s it, short and sweet. If you follow those rules when naming variables, you’re not going to go wrong.