MATRIX and Other Commands (MATRIX-END MATRIX command)
A matrix program is a single procedure within a session.
- No active dataset is needed to run a matrix program.
If one exists, it is ignored during matrix processing unless you specifically
reference it (with an asterisk) on the
GET
,SAVE
,MGET
, orMSAVE
statements. - The
GET
,SAVE
,MGET
, orMSAVE
statements support both dataset references and physical file specifications. Take the following example:DATASET CLOSE ALL. NEW FILE. GET FILE 'Samples\English\Employee data.sav'. DATASET DECLARE corr. CORRELATIONS bdate to minority /MATRIX=out(corr). MATRIX. MGET /file=corr/type=corr. PRINT CR. END MATRIX.
The example uses
corr
as a reference to a virtual dataset. The correlation output can also be saved to a physical file. - Variables defined in the active dataset are unavailable
during matrix processing, except with the
GET
orMGET
statements. - Matrix variables are unavailable after the
END MATRIX
command unless you useSAVE
orMSAVE
to write them to the active dataset. - You cannot run a matrix program from a syntax window
if split-file processing is in effect. If you save the matrix program
into a syntax file, however, you can use the
INCLUDE
command to run the program even if split-file processing is in effect.