Previous Topic: Variables, Substitution, and Assignment

Next Topic: Variable Types

What Is a Variable?

The term variable describes a word that may represent different values within a statement. A variable commences with an ampersand (&) and is followed by 1 to 12 characters that form the name of the variable.

A variable name can contain the characters $, #, @, A to Z, and 0 to 9. The name is delimited by the first blank or non-valid character. Although the names of variables can be coded to contain both upper and lower case characters (A to Z) they are treated internally as being entirely upper case.

However, when operating in a system where support for double byte character stream (DBCS) terminals is active, no translation to upper case is performed.

If a variable name starts with a digit, the whole variable name must be numeric.