OUTFILE Specification (MATRIX-END MATRIX command)

OUTFILE designates the file to which the matrix expression is to be written. It can be an actual filename in quotes or a file handle defined on a FILE HANDLE command that precedes the matrix program.

  • To save a matrix expression as the active dataset, specify an asterisk (*). If there is no active dataset, one will be created; if there is one, it is replaced by the saved matrices.
  • Both dataset references and physical file specifications are supported.
  • The OUTFILE specification is required on the first SAVE statement in a matrix program (first in order of appearance, not necessarily in order of execution). If you omit the OUTFILE specification from a later SAVE statement, the statement uses the most recently named file (in order of appearance) on a SAVE statement in the same matrix program.
  • If more than one SAVE statement writes to the active dataset in a single matrix program, the dictionary of the new active dataset is written on the basis of the information given by the first such SAVE. All of the subsequently saved matrices are appended to the new active dataset as additional cases. If the number of columns differs, an error occurs.
  • When you execute a matrix program with the INCLUDE command, the SAVE statement creates a new IBM® SPSS® Statistics data file at the end of the matrix program’s execution, so any attempt to GET the data file obtains the original data file, if any.
  • When you execute a matrix program from a syntax window, SAVE creates a new IBM SPSS Statistics data file immediately, but the file remains open, so you cannot GET it until after the END MATRIX statement.