String Values on COMPUTE Statements (MATRIX-END MATRIX command)

Matrix variables, unlike those in the transformation language, are not checked for data type (numeric or string) when you use them in a COMPUTE statement.

  • Numerical calculations with matrices containing string values will produce meaningless results.
  • One or more elements of a matrix can be set equal to string constants by enclosing the string constants in quotes on a COMPUTE statement.
  • String values can be copied from one matrix to another with the COMPUTE statement.
  • There is no way to display a matrix that contains both numeric and string values, if you compute one for some reason.

Example

COMPUTE LABELS={"Observe", "Predict", "Error"}.
PRINT LABELS /FORMAT=A7.
  • LABELS is a row vector containing three string values.