1 @c PSPP - a program for statistical analysis.
2 @c Copyright (C) 2017, 2020 Free Software Foundation, Inc.
3 @c Permission is granted to copy, distribute and/or modify this document
4 @c under the terms of the GNU Free Documentation License, Version 1.3
5 @c or any later version published by the Free Software Foundation;
6 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
7 @c A copy of the license is included in the section entitled "GNU
8 @c Free Documentation License".
10 @node Manipulating Variables
11 @chapter Manipulating Variables
14 Every value in a dataset is associated with a @dfn{variable}.
15 Variables describe what the values represent and properties of those values,
16 such as the format in which they should be displayed, whether they are numeric
17 or alphabetic and how missing values should be represented.
18 There are several utility commands for examining and adjusting variables.
21 * DISPLAY:: Display information about the active dataset.
22 * NUMERIC:: Create new numeric variables.
23 * STRING:: Create new string variables.
24 * RENAME VARIABLES:: Rename variables.
25 * SORT VARIABLES:: Reorder variables.
26 * DELETE VARIABLES:: Delete variables.
27 * VARIABLE LABELS:: Set variable labels for variables.
28 * PRINT FORMATS:: Set variable print formats.
29 * WRITE FORMATS:: Set variable write formats.
30 * FORMATS:: Set print and write formats.
31 * VALUE LABELS:: Set value labels for variables.
32 * ADD VALUE LABELS:: Add value labels to variables.
33 * MISSING VALUES:: Set missing values for variables.
34 * VARIABLE ATTRIBUTE:: Set custom attributes on variables.
35 * VARIABLE ALIGNMENT:: Set the alignment for display.
36 * VARIABLE WIDTH:: Set the display width.
37 * VARIABLE LEVEL:: Set the measurement level.
38 * VARIABLE ROLE:: Set the role that a variable fills in analysis.
39 * VECTOR:: Declare an array of variables.
40 * MRSETS:: Add, modify, and list multiple response sets.
41 * LEAVE:: Don't clear variables between cases.
48 The @cmd{DISPLAY} command displays information about the variables in the active dataset.
49 A variety of different forms of information can be requested.
50 By default, all variables in the active dataset are displayed. However you can select
51 variables of interest using the @subcmd{/VARIABLES} subcommand.
54 DISPLAY [SORTED] NAMES [[/VARIABLES=]@var{var_list}].
55 DISPLAY [SORTED] INDEX [[/VARIABLES=]@var{var_list}].
56 DISPLAY [SORTED] LABELS [[/VARIABLES=]@var{var_list}].
57 DISPLAY [SORTED] VARIABLES [[/VARIABLES=]@var{var_list}].
58 DISPLAY [SORTED] DICTIONARY [[/VARIABLES=]@var{var_list}].
59 DISPLAY [SORTED] SCRATCH [[/VARIABLES=]@var{var_list}].
60 DISPLAY [SORTED] ATTRIBUTES [[/VARIABLES=]@var{var_list}].
61 DISPLAY [SORTED] @@ATTRIBUTES [[/VARIABLES=]@var{var_list}].
62 DISPLAY [SORTED] VECTORS.
65 The following keywords primarily cause information about variables to
66 be displayed. With these keywords, by default information is
67 displayed about all variable in the active dataset, in the order that
68 variables occur in the active dataset dictionary. The @subcmd{SORTED} keyword
69 causes output to be sorted alphabetically by variable name.
73 The variables' names are displayed.
76 The variables' names are displayed along with a value describing their
77 position within the active dataset dictionary.
80 Variable names, positions, and variable labels are displayed.
83 Variable names, positions, print and write formats, and missing values
87 Variable names, positions, print and write formats, missing values,
88 variable labels, and value labels are displayed.
91 Variable names are displayed, for scratch variables only (@pxref{Scratch
96 Datafile and variable attributes are displayed.
97 The first form of the command omits those attributes
98 whose names begin with @code{@@} or @code{$@@}.
99 In the second for, all datafile and variable attributes are displayed.
102 With the @code{VECTOR} keyword, @cmd{DISPLAY} lists all the currently
103 declared vectors. If the @subcmd{SORTED} keyword is given, the vectors are
104 listed in alphabetical order; otherwise, they are listed in textual
105 order of definition within the @pspp{} syntax file.
107 For related commands, see @ref{DISPLAY DOCUMENTS} and @ref{DISPLAY
114 @cmd{NUMERIC} explicitly declares new numeric variables, optionally
115 setting their output formats.
118 NUMERIC @var{var_list} [(@var{fmt_spec})] [/@var{var_list} [(@var{fmt_spec})]]@dots{}
121 Specify the names of the new numeric variables as @var{var_list}. If
122 you wish to set the variables' output formats, follow their names by
123 an output format specification in parentheses (@pxref{Input and Output
124 Formats}); otherwise, the default is F8.2.
126 Variables created with @cmd{NUMERIC} are initialized to the
127 system-missing value.
133 @cmd{STRING} creates new string variables.
136 STRING @var{var_list} (@var{fmt_spec}) [/@var{var_list} (@var{fmt_spec})] [@dots{}].
139 Specify a list of names for the variable you want to create,
140 followed by the desired output format specification in
141 parentheses (@pxref{Input and Output Formats}).
143 implicitly derived from the specified output formats.
144 The created variables will be initialized to spaces.
146 If you want to create several variables with distinct
147 output formats, you can either use two or more separate @cmd{STRING} commands,
148 or you can specify further variable list and format specification pairs, each separated
149 from the previous by a slash (@samp{/}).
151 The following example is one way to create three string variables; Two of the
152 variables have format A24 and the other A80:
154 STRING firstname lastname (A24) / address (A80).
157 @noindent Here is another way to achieve the same result:
159 STRING firstname lastname (A24).
160 STRING address (A80).
163 @noindent @dots{} and here is yet another way:
166 STRING firstname (A24).
167 STRING lastname (A24).
168 STRING address (A80).
171 @node RENAME VARIABLES
172 @section RENAME VARIABLES
173 @vindex RENAME VARIABLES
175 @cmd{RENAME VARIABLES} changes the names of variables in the active
179 RENAME VARIABLES (@var{old_names}=@var{new_names})@dots{} .
182 Specify lists of the old variable names and new
183 variable names, separated by an equals sign (@samp{=}), within
184 parentheses. There must be the same number of old and new variable
185 names. Each old variable is renamed to the corresponding new variable
186 name. Multiple parenthesized groups of variables may be specified.
187 When the old and new variable names contain only a single variable name,
188 the parentheses are optional.
190 @cmd{RENAME VARIABLES} takes effect immediately. It does not cause the data
193 @cmd{RENAME VARIABLES} may not be specified following @cmd{TEMPORARY}
197 @section SORT VARIABLES
198 @vindex SORT VARIABLES
200 @cmd{SORT VARIABLES} reorders the variables in the active dataset's dictionary
201 according to a chosen sort key.
205 (NAME | TYPE | FORMAT | LABEL | VALUES | MISSING | MEASURE
206 | ROLE | COLUMNS | ALIGNMENT | ATTRIBUTE @var{name})
210 The main specification is one of the following identifiers, which
211 determines how the variables are sorted:
215 Sorts the variables according to their names, in a case-insensitive
216 fashion. However, when variable names differ only in a number at the
217 end, they are sorted numerically. For example, @code{VAR5} is sorted
218 before @code{VAR400} even though @samp{4} precedes @samp{5}.
221 Sorts numeric variables before string variables, and shorter string
222 variables before longer ones.
225 Groups variables by print format; within a format, sorts narrower
226 formats before wider ones; with the same format and width, sorts fewer
227 decimal places before more decimal places.
231 Sorts variables without a variable label before those with one.
232 @xref{VARIABLE LABELS}.
235 Sorts variables without value labels before those with some.
239 Sorts variables without missing values before those with some.
240 @xref{MISSING VALUES}.
243 Sorts nominal variables first, followed by ordinal variables, followed
244 by scale variables. @xref{VARIABLE LEVEL}.
247 Groups variables according to their role. @xref{VARIABLE ROLE}.
250 Sorts variables in ascending display width. @xref{VARIABLE WIDTH}.
253 Sorts variables according to their alignment, first left-aligned, then
254 right-aligned, then centered. @xref{VARIABLE ALIGNMENT}.
256 @item ATTRIBUTE @var{name}
257 Sorts variables according to the first value of their @var{name}
258 attribute. Variables without attribute are sorted first.
259 @xref{VARIABLE ATTRIBUTE}.
262 Only one sort criterion can be specified. The sort is ``stable,'' so
263 to sort on multiple criteria one may perform multiple sorts. For
264 example, the following will sort primarily based on alignment, with
265 variables that have the same alignment ordered based on display width:
268 SORT VARIABLES BY COLUMNS.
269 SORT VARIABLES BY ALIGNMENT.
272 Specify @code{(D)} to reverse the sort order.
274 @node DELETE VARIABLES
275 @section DELETE VARIABLES
276 @vindex DELETE VARIABLES
278 @cmd{DELETE VARIABLES} deletes the specified variables from the dictionary.
281 DELETE VARIABLES @var{var_list}.
284 @cmd{DELETE VARIABLES} should not be used after defining transformations
285 but before executing a procedure. If it is used in such a context, it
286 causes the data to be read. If it is used while @cmd{TEMPORARY} is in
287 effect, it causes the temporary transformations to become permanent.
289 @cmd{DELETE VARIABLES} may not be used to delete all variables from the
290 dictionary; use @cmd{NEW FILE} to do that (@pxref{NEW FILE}).
292 @node VARIABLE LABELS
293 @section VARIABLE LABELS
294 @vindex VARIABLE LABELS
296 In addition to a variable's name, each variable can have a
297 @dfn{label}. Whereas a variable name is a concise, easy-to-type
298 mnemonic for the variable, a label may be longer and more descriptive.
302 @var{variable} '@var{label}'
303 [@var{variable} '@var{label}']@dots{}
306 @cmd{VARIABLE LABELS} associates explanatory names
307 with variables. This name, called a @dfn{variable label}, is displayed by
308 statistical procedures.
310 Specify each variable followed by its label as a quoted string.
311 Variable-label pairs may be separated by an optional slash @samp{/}.
313 If a listed variable already has a label, the new one replaces it.
314 Specifying an empty string as the label, e.g.@:@samp{''}, removes a
318 @section PRINT FORMATS
319 @vindex PRINT FORMATS
322 PRINT FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
325 @cmd{PRINT FORMATS} sets the print formats for the specified
326 variables to the specified format specification.
328 Its syntax is identical to that of @cmd{FORMATS} (@pxref{FORMATS}),
329 but @cmd{PRINT FORMATS} sets only print formats, not write formats.
332 @section WRITE FORMATS
333 @vindex WRITE FORMATS
336 WRITE FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
339 @cmd{WRITE FORMATS} sets the write formats for the specified variables
340 to the specified format specification. Its syntax is identical to
341 that of @cmd{FORMATS} (@pxref{FORMATS}), but @cmd{WRITE FORMATS} sets only
342 write formats, not print formats.
349 FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
352 @cmd{FORMATS} set both print and write formats for the specified
353 variables to the specified format specification.
354 @xref{Input and Output Formats}.
356 Specify a list of variables followed by a format specification in
357 parentheses. The print and write formats of the specified variables
358 will be changed. All of the variables listed together must have
359 the same type and, for string variables, the same width.
361 Additional lists of variables and formats may be included following
364 @cmd{FORMATS} takes effect immediately. It is not affected by
365 conditional and looping structures such as @cmd{DO IF} or @cmd{LOOP}.
368 @section VALUE LABELS
371 The values of a variable can be associated with an arbitrary text string.
372 In this way, a short value can stand for a longer, more descriptive label.
374 Both numeric and string variables can be given labels. For string
375 variables, the values are case-sensitive, so that, for example, a
376 capitalized value and its lowercase variant would have to be labeled
377 separately if both are present in the data.
381 /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
384 @cmd{VALUE LABELS} allows values of variables to be associated with labels.
386 To set up value labels for one or more variables, specify the
387 variable names after a slash (@samp{/}), followed by a list of values
388 and their associated labels, separated by spaces.
390 Value labels in output are normally broken into lines automatically.
391 Put @samp{\n} in a label string to force a line break at that point.
392 The label may still be broken into lines at additional points.
394 Before @cmd{VALUE LABELS} is executed, any existing value labels
395 are cleared from the variables specified. Use @cmd{ADD VALUE LABELS}
396 (@pxref{ADD VALUE LABELS}) to add value labels without clearing those
399 @node ADD VALUE LABELS
400 @section ADD VALUE LABELS
401 @vindex ADD VALUE LABELS
403 @cmd{ADD VALUE LABELS} has the same syntax and purpose as @cmd{VALUE
404 LABELS} (@pxref{VALUE LABELS}), but it does not clear value
405 labels from the variables before adding the ones specified.
409 /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
414 @section MISSING VALUES
415 @vindex MISSING VALUES
417 In many situations the data available for analysis is incomplete and a placeholder
418 must be used in place of a value to indicate that the value is unknown. One way
419 that missing values are represented is through the $SYSMIS variable
420 (@pxref{System Variables}). Another, more flexible way is through
421 @dfn{user-missing values} which are determined on a per variable basis.
423 The @cmd{MISSING VALUES} command sets user-missing values for variables.
426 MISSING VALUES @var{var_list} (@var{missing_values}).
428 where @var{missing_values} takes one of the following forms:
430 @var{num1}, @var{num2}
431 @var{num1}, @var{num2}, @var{num3}
432 @var{num1} THRU @var{num2}
433 @var{num1} THRU @var{num2}, @var{num3}
435 @var{string1}, @var{string2}
436 @var{string1}, @var{string2}, @var{string3}
437 As part of a range, @subcmd{LO} or @subcmd{LOWEST} may take the place of @var{num1};
438 @subcmd{HI} or @subcmd{HIGHEST} may take the place of @var{num2}.
441 @cmd{MISSING VALUES} sets user-missing values for numeric and string
442 variables. Long string variables may have missing values, but
443 characters after the first 8 bytes of the missing value must be
446 Specify a list of variables, followed by a list of their user-missing
447 values in parentheses. Up to three discrete values may be given, or,
448 for numeric variables only, a range of values optionally accompanied by
449 a single discrete value. Ranges may be open-ended on one end, indicated
450 through the use of the
451 keyword @subcmd{LO} or @subcmd{LOWEST} or @subcmd{HI} or @subcmd{HIGHEST}.
453 The @cmd{MISSING VALUES} command takes effect immediately. It is not
454 affected by conditional and looping constructs such as @cmd{DO IF} or
457 @node VARIABLE ATTRIBUTE
458 @section VARIABLE ATTRIBUTE
459 @vindex VARIABLE ATTRIBUTE
461 @cmd{VARIABLE ATTRIBUTE} adds, modifies, or removes user-defined
462 attributes associated with variables in the active dataset. Custom
463 variable attributes are not interpreted by @pspp{}, but they are saved as
464 part of system files and may be used by other software that reads
469 VARIABLES=@var{var_list}
470 ATTRIBUTE=@var{name}('@var{value}') [@var{name}('@var{value}')]@dots{}
471 ATTRIBUTE=@var{name}@b{[}@var{index}@b{]}('@var{value}') [@var{name}@b{[}@var{index}@b{]}('@var{value}')]@dots{}
472 DELETE=@var{name} [@var{name}]@dots{}
473 DELETE=@var{name}@b{[}@var{index}@b{]} [@var{name}@b{[}@var{index}@b{]}]@dots{}
476 The required @subcmd{VARIABLES} subcommand must come first. Specify the
477 variables to which the following @subcmd{ATTRIBUTE} or @subcmd{DELETE} subcommand
480 Use the @subcmd{ATTRIBUTE} subcommand to add or modify custom variable
481 attributes. Specify the name of the attribute as an identifier
482 (@pxref{Tokens}), followed by the desired value, in parentheses, as a
483 quoted string. The specified attributes are then added or modified in
484 the variables specified on @subcmd{VARIABLES}. Attribute names that begin with
485 @code{$} are reserved for @pspp{}'s internal use, and attribute names
486 that begin with @code{@@} or @code{$@@} are not displayed by most @pspp{}
487 commands that display other attributes. Other attribute names are not
490 Attributes may also be organized into arrays. To assign to an array
491 element, add an integer array index enclosed in square brackets
492 (@code{[} and @code{]}) between the attribute name and value. Array
493 indexes start at 1, not 0. An attribute array that has a single
494 element (number 1) is not distinguished from a non-array attribute.
496 Use the @subcmd{DELETE} subcommand to delete an attribute from the variable
497 specified on @subcmd{VARIABLES}. Specify an attribute name by itself to delete
498 an entire attribute, including all array elements for attribute
499 arrays. Specify an attribute name followed by an array index in
500 square brackets to delete a single element of an attribute array. In
501 the latter case, all the array elements numbered higher than the
502 deleted element are shifted down, filling the vacated position.
504 To associate custom attributes with the entire active dataset, instead of
505 with particular variables, use @cmd{DATAFILE ATTRIBUTE} (@pxref{DATAFILE ATTRIBUTE}) instead.
507 @cmd{VARIABLE ATTRIBUTE} takes effect immediately. It is not affected
508 by conditional and looping structures such as @cmd{DO IF} or
511 @node VARIABLE ALIGNMENT
512 @section VARIABLE ALIGNMENT
513 @vindex VARIABLE ALIGNMENT
515 @cmd{VARIABLE ALIGNMENT} sets the alignment of variables for display editing
516 purposes. It does not affect the display of variables in the @pspp{} output.
520 @var{var_list} ( LEFT | RIGHT | CENTER )
521 [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
525 [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
529 @section VARIABLE WIDTH
530 @vindex VARIABLE WIDTH
533 @var{var_list} (width)
534 [ /@var{var_list} (width) ]
538 [ /@var{var_list} (width) ]
541 @cmd{VARIABLE WIDTH} sets the column width of variables for display editing
542 purposes. It does not affect the display of variables in the @pspp{} output.
546 @section VARIABLE LEVEL
547 @vindex VARIABLE LEVEL
549 @t{VARIABLE LEVEL} @i{variables} @t{(}@{@t{SCALE} @math{|} @t{NOMINAL} @math{|} @t{ORDINAL}@}@t{)}@dots{}
552 @cmd{VARIABLE LEVEL} sets the measurement level of @var{variables} as
553 specified. @xref{Attributes}, for the definitions of the available
557 @section VARIABLE ROLE
558 @vindex VARIABLE ROLE
561 /@var{role} @var{var_list}
562 [/@var{role} @var{var_list}]@dots{}
565 @cmd{VARIABLE ROLE} sets the intended role of a variable for use in
566 dialog boxes in graphical user interfaces. Each @var{role} specifies
567 one of the following roles for the variables that follow it:
571 An input variable, such as an independent variable.
574 An output variable, such as a dependent variable.
577 A variable used for input and output.
580 No role assigned. (This is a variable's default role.)
583 Used to break the data into groups for testing.
586 No meaning except for certain third party software. (This role's
587 meaning is unrelated to @cmd{SPLIT FILE}.)
590 The PSPPIRE GUI does not yet use variable roles as intended.
597 Two possible syntaxes:
598 VECTOR @var{vec_name}=@var{var_list}.
599 VECTOR @var{vec_name_list}(@var{count} [@var{format}]).
602 @cmd{VECTOR} allows a group of variables to be accessed as if they
603 were consecutive members of an array with a vector(index) notation.
605 To make a vector out of a set of existing variables, specify a name
606 for the vector followed by an equals sign (@samp{=}) and the variables
607 to put in the vector. The variables must be all numeric or all
608 string, and string variables must have the same width.
610 To make a vector and create variables at the same time, specify one or
611 more vector names followed by a count in parentheses. This will
612 create variables named @code{@var{vec}1} through
613 @code{@var{vec}@var{count}}. By default, the new variables are
614 numeric with format F8.2, but an alternate format may be specified
615 inside the parentheses before or after the count and separated from it
616 by white space or a comma. With a string format such as A8, the
617 variables will be string variables; with a numeric format, they will
618 be numeric. Variable names including the suffixes may not exceed 64
619 characters in length, and none of the variables may exist prior to
622 Vectors created with @cmd{VECTOR} disappear after any procedure or
623 procedure-like command is executed. The variables contained in the
624 vectors remain, unless they are scratch variables (@pxref{Scratch
627 Variables within a vector may be referenced in expressions using
628 @code{vector(index)} syntax.
634 @cmd{MRSETS} creates, modifies, deletes, and displays multiple
635 response sets. A multiple response set is a set of variables that
636 represent multiple responses to a survey question.
638 Multiple responses are represented in one of the two following ways:
642 A @dfn{multiple dichotomy set} is analogous to a survey question with
643 a set of checkboxes. Each variable in the set is treated in a Boolean
644 fashion: one value (the "counted value") means that the box was
645 checked, and any other value means that it was not.
648 A @dfn{multiple category set} represents a survey question where the
649 respondent is instructed to list up to @var{n} choices. Each variable
650 represents one of the responses.
655 /MDGROUP NAME=@var{name} VARIABLES=@var{var_list} VALUE=@var{value}
656 [CATEGORYLABELS=@{VARLABELS,COUNTEDVALUES@}]
657 [@{LABEL='@var{label}',LABELSOURCE=VARLABEL@}]
659 /MCGROUP NAME=@var{name} VARIABLES=@var{var_list} [LABEL='@var{label}']
661 /DELETE NAME=@{[@var{names}],ALL@}
663 /DISPLAY NAME=@{[@var{names}],ALL@}
667 Any number of subcommands may be specified in any order.
669 The @subcmd{MDGROUP} subcommand creates a new multiple dichotomy set or
670 replaces an existing multiple response set. The @subcmd{NAME},
671 @subcmd{VARIABLES}, and
672 @subcmd{VALUE} specifications are required. The others are optional:
676 @var{NAME} specifies the name used in syntax for the new multiple dichotomy
677 set. The name must begin with @samp{$}; it must otherwise follow the
678 rules for identifiers (@pxref{Tokens}).
681 @subcmd{VARIABLES} specifies the variables that belong to the set. At least
682 two variables must be specified. The variables must be all string or
686 @subcmd{VALUE} specifies the counted value. If the variables are numeric, the
687 value must be an integer. If the variables are strings, then the
688 value must be a string that is no longer than the shortest of the
689 variables in the set (ignoring trailing spaces).
692 @subcmd{CATEGORYLABELS} optionally specifies the source of the labels for each
697 @subcmd{VARLABELS}, the default, uses variable labels or, for variables without
698 variable labels, variable names. @pspp{} warns if two variables have the
699 same variable label, since these categories cannot be distinguished in
703 @subcmd{COUNTEDVALUES} instead uses each variable's value label for the counted
704 value. @pspp{} warns if two variables have the same value label for the
705 counted value or if one of the variables lacks a value label, since
706 such categories cannot be distinguished in output.
710 @subcmd{LABEL} optionally specifies a label for the multiple response set. If
711 neither @subcmd{LABEL} nor @subcmd{LABELSOURCE=VARLABEL} is specified, the set is
715 @subcmd{LABELSOURCE=VARLABEL} draws the multiple response set's label from the
716 first variable label among the variables in the set; if none of the
717 variables has a label, the name of the first variable is used.
718 @subcmd{LABELSOURCE=VARLABEL} must be used with @subcmd{CATEGORYLABELS=COUNTEDVALUES}.
719 It is mutually exclusive with @subcmd{LABEL}.
722 The @subcmd{MCGROUP} subcommand creates a new multiple category set or
723 replaces an existing multiple response set. The @subcmd{NAME} and @subcmd{VARIABLES}
724 specifications are required, and @subcmd{LABEL} is optional. Their meanings
725 are as described above in @subcmd{MDGROUP}. @pspp{} warns if two variables in the
726 set have different value labels for a single value, since each of the
727 variables in the set should have the same possible categories.
729 The @subcmd{DELETE} subcommand deletes multiple response groups. A list of
730 groups may be named within a set of required square brackets, or ALL
731 may be used to delete all groups.
733 The @subcmd{DISPLAY} subcommand displays information about defined multiple
734 response sets. Its syntax is the same as the @subcmd{DELETE} subcommand.
736 Multiple response sets are saved to and read from system files by,
737 @i{e.g.}, the @cmd{SAVE} and @cmd{GET} command. Otherwise, multiple
738 response sets are currently used only by third party software.
744 @cmd{LEAVE} prevents the specified variables from being
745 reinitialized whenever a new case is processed.
748 LEAVE @var{var_list}.
751 Normally, when a data file is processed, every variable in the active
752 dataset is initialized to the system-missing value or spaces at the
753 beginning of processing for each case. When a variable has been
754 specified on @cmd{LEAVE}, this is not the case. Instead, that variable is
755 initialized to 0 (not system-missing) or spaces for the first case.
756 After that, it retains its value between cases.
758 This becomes useful for counters. For instance, in the example below
759 the variable @code{SUM} maintains a running total of the values in the @code{ITEM}
764 COMPUTE SUM=SUM+ITEM.
775 @noindent Partial output from this example:
784 It is best to use @cmd{LEAVE} command immediately before invoking a
785 procedure command, because the left status of variables is reset by
786 certain transformations---for instance, @cmd{COMPUTE} and @cmd{IF}.
787 Left status is also reset by all procedure invocations.