Overview (ADD VALUE LABELS command)

ADD VALUE LABELS adds or alters value labels without affecting other value labels already defined for that variable. In contrast, VALUE LABELS adds or alters value labels but deletes all existing value labels for that variable when it does so.

Basic Specification

The basic specification is a variable name and individual values with associated labels.

Syntax Rules

  • Labels can be assigned to values of any previously defined variable. It is not necessary to enter value labels for all of a variable’s values.
  • Each value label must be enclosed in single or double quotes.
  • To specify a single quote or apostrophe within a quoted string, either enclose the entire string in double quotes or double the single quote/apostrophe.
  • Value labels can contain any characters, including blanks.
  • The same labels can be assigned to the same values of different variables by specifying a list of variable names. For string variables, the variables on the list must have the same defined width (for example, A8).
  • Multiple sets of variable names and value labels can be specified on one ADD VALUE LABELS command as long as each set is separated from the previous one by a slash.
  • To continue a label from one command line to the next, specify a plus sign (+) before the continuation of the label and enclose each segment of the label, including the blank between them, in single or double quotes.

Operations

  • Unlike most transformations, ADD VALUE LABELS takes effect as soon as it is encountered in the command sequence. Thus, special attention should be paid to its position among commands.
  • The added value labels are stored in the active dataset dictionary.
  • ADD VALUE LABELS can be used for variables that have no previously assigned value labels.
  • Adding labels to some values does not affect labels previously assigned to other values.

Limitations

  • Value labels cannot exceed 120 bytes.