Examples (XSAVE command)
Using XSAVE to Consolidate Two Data Passes Into One
GET FILE='/data/hubempl.sav'.
XSAVE OUTFILE='/data/empl88.sav'
/RENAME=(AGE=AGE88) (JOBCAT=JOBCAT88).
MEANS RAISE88 BY DEPT88.
- The
GETcommand retrieves the IBM® SPSS® Statistics data file hubempl.sav. - The
RENAMEsubcommand renames variable AGE to AGE88 and variable JOBCAT to JOBCAT88. -
XSAVEis not executed until the program reads the data for procedureMEANS. The program saves file empl88.sav and generates aMEANStable in a single data pass. - After
MEANSis executed, the hubempl.sav file is still the active dataset. Variables AGE and JOBCAT retain their original names in the active dataset.
Using Temporary Transformations With XSAVE
GET FILE=hubempl.sav.
TEMPORARY.
RECODE DEPT85 TO DEPT88 (1,2=1) (3,4=2) (ELSE=9).
VALUE LABELS DEPT85 TO DEPT88 1 'MANAGEMENT' 2 'OPERATIONS' 3 'UNKNOWN'.
XSAVE OUTFILE='/data/hubtemp.sav'.
CROSSTABS DEPT85 TO DEPT88 BY JOBCAT.
- Both the saved data file and the
CROSSTABSoutput will reflect the temporary recoding and labeling of the department variables. - If
SAVEwere specified instead ofXSAVE, the data would be read twice instead of once and theCROSSTABSoutput would not reflect the recoding.