Next: , Previous: Variables, Up: Variables



4.6.1 Attributes of Variables

Each variable has a number of attributes, including:

Name
An identifier, up to 64 bytes long. Each variable must have a different name. See Tokens.

Some system variable names begin with $, but user-defined variables' names may not begin with $.

The final character in a variable name should not be ., because such an identifier will be misinterpreted when it is the final token on a line: FOO. will be divided into two separate tokens, FOO and ., indicating end-of-command. See Tokens.

The final character in a variable name should not be _, because some such identifiers are used for special purposes by PSPP procedures.

As with all PSPP identifiers, variable names are not case-sensitive. PSPP capitalizes variable names on output the same way they were capitalized at their point of definition in the input.


Type
Numeric or string.


Width
(string variables only) String variables with a width of 8 characters or fewer are called short string variables. Short string variables can be used in many procedures where long string variables (those with widths greater than 8) are not allowed.

Certain systems may consider strings longer than 8 characters to be short strings. Eight characters represents a minimum figure for the maximum length of a short string.

Position
Variables in the dictionary are arranged in a specific order. DISPLAY can be used to show this order: see DISPLAY.
Initialization
Either reinitialized to 0 or spaces for each case, or left at its existing value. See LEAVE.


Missing values
Optionally, up to three values, or a range of values, or a specific value plus a range, can be specified as user-missing values. There is also a system-missing value that is assigned to an observation when there is no other obvious value for that observation. Observations with missing values are automatically excluded from analyses. User-missing values are actual data values, while the system-missing value is not a value at all. See Missing Observations.


Variable label
A string that describes the variable. See VARIABLE LABELS.


Value label
Optionally, these associate each possible value of the variable with a string. See VALUE LABELS.


Print format
Display width, format, and (for numeric variables) number of decimal places. This attribute does not affect how data are stored, just how they are displayed. Example: a width of 8, with 2 decimal places. See PRINT FORMATS.


Write format
Similar to print format, but used by certain commands that are designed to write to binary files. See WRITE FORMATS.