Overview (TEMPORARY command)
TEMPORARY signals the beginning of temporary transformations that are in effect
only for the next procedure. With the exception of variables created
or modified by the next procedure (for example, residual values saved
as variables by REGRESSION),
numeric or string variables created while the TEMPORARY command is in effect are temporary variables,
and any modifications made to existing variables while the TEMPORARY command is in effect are also
temporary. Any variables created or modified by the next procedure
are permanent.
With TEMPORARY, you can perform separate analyses for subgroups in the data and
then repeat the analysis for the file as a whole. You can also use TEMPORARY to transform data for one analysis
but not for other subsequent analyses.
TEMPORARY can
be applied to the following commands:
- Transformation commands
COMPUTE,RECODE,IF, andCOUNT, and theDO REPEATutility. - The
LOOPandDO IFstructures. - Format commands
PRINT FORMATS,WRITE FORMATS, andFORMATS. - Data selection commands
SELECT IF,SAMPLE,FILTER, andWEIGHT. - Variable declarations
NUMERIC,STRING, andVECTOR. - Labeling commands
VARIABLE LABELSandVALUE LABELS, and theMISSING VALUEScommand. -
SPLIT FILE. -
PRINT, WRITE, XSAVE.
Basic specification
The only
specification is the keyword TEMPORARY. There are no additional specifications.
Operations
- Once
TEMPORARYis specified, you cannot refer to previously existing scratch variables. - Temporary transformations apply to the next command that reads the data. Once the data are read, the temporary transformations are no longer in effect.
- The
XSAVEcommand leaves temporary transformations in effect.SAVE, however, reads the data and turns temporary transformations off after the file is written. (See Examples.) -
TEMPORARYcannot be used withSORT CASES,MATCH FILES,ADD FILES, orCOMPUTEwith aLAGfunction. If any of these commands followsTEMPORARYin the command sequence, there must be an intervening procedure or command that reads the data to first execute theTEMPORARYcommand. -
TEMPORARYcannot be used within theDO IF—END IForLOOP—END LOOPstructures.
If any variables have an unknown measurement level, the measurement
level for those variables remains unknown after a procedure that follows
a TEMPORARY command. (In the
absence of the TEMPORARY command,
the data pass performed by the procedure would assign default measurement
levels to all variables with an unknown measurement level.)