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 REPEAT
utility. - The
LOOP
andDO IF
structures. - Format commands
PRINT FORMATS
,WRITE FORMATS
, andFORMATS
. - Data selection commands
SELECT IF
,SAMPLE
,FILTER
, andWEIGHT
. - Variable declarations
NUMERIC
,STRING
, andVECTOR
. - Labeling commands
VARIABLE LABELS
andVALUE LABELS
, and theMISSING VALUES
command. -
SPLIT FILE
. -
PRINT, WRITE, XSAVE
.
Basic specification
The only
specification is the keyword TEMPORARY
. There are no additional specifications.
Operations
- Once
TEMPORARY
is 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
XSAVE
command leaves temporary transformations in effect.SAVE
, however, reads the data and turns temporary transformations off after the file is written. (See Examples.) -
TEMPORARY
cannot be used withSORT CASES
,MATCH FILES
,ADD FILES
, orCOMPUTE
with aLAG
function. If any of these commands followsTEMPORARY
in the command sequence, there must be an intervening procedure or command that reads the data to first execute theTEMPORARY
command. -
TEMPORARY
cannot be used within theDO IF—END IF
orLOOP—END LOOP
structures.
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.)