According to the SAS documentation
VALIDVARNAME=V7 | UPCASE | ANY
Syntax Description
V7
specifies that variable names must follow these rules:
The name can be up to 32 characters.
The first character must begin with a letter of the Latin alphabet (A - Z, a - z) or the underscore. Subsequent characters can be letters of the Latin alphabet, numerals, or underscores.
Trailing blanks are ignored. The variable name alignment is left-justified.
A variable name cannot contain blanks or special characters except for the underscore.
A variable name can contain mixed-case letters. SAS stores and writes the variable name in the same case that is used in the first reference to the variable. However, when SAS processes a variable name, SAS internally converts it to uppercase. Therefore, you cannot use the same variable name with a different combination of uppercase and lowercase letters to represent different variables. For example, cat , Cat , and CAT all represent the same variable.
Do not assign variables the names of special SAS automatic variables (such as _N_ and _ERROR_) or variable list names (such as _NUMERIC_, _CHARACTER_, and _ALL_) to variables.
And when you ask "Why do we need VALIDVARNAME=V7?" you may or may not need it, its an option you can choose, but you can also choose other options based on your current needs. Depending on what user interface you are accessing SAS through, some default to VALIDVARNAME=V7, while other interfaces use a different default, or you may want to change the default if that makes more sense in your situation.
... View more