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 @dfn{label}.
297 Whereas the name is limited to certain constraints (@pxref{Attributes}) a variable's
298 label has no such constraints.
299 Typically, the names are concise, easy to type mnemonics for the variable
300 and the labels are longer, more verbose descriptions.
304 @var{var_list} '@var{var_label}'
305 [ /@var{var_list} '@var{var_label}']
309 [ /@var{var_list} '@var{var_label}']
312 @cmd{VARIABLE LABELS} associates explanatory names
313 with variables. This name, called a @dfn{variable label}, is displayed by
314 statistical procedures.
316 To assign a variable label to a group of variables, specify a
317 list of variable names and the variable label as a string.
318 To assign different labels to different variables in the same command,
319 precede the subsequent variable list with a slash (@samp{/}).
322 @section PRINT FORMATS
323 @vindex PRINT FORMATS
326 PRINT FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
329 @cmd{PRINT FORMATS} sets the print formats for the specified
330 variables to the specified format specification.
332 Its syntax is identical to that of @cmd{FORMATS} (@pxref{FORMATS}),
333 but @cmd{PRINT FORMATS} sets only print formats, not write formats.
336 @section WRITE FORMATS
337 @vindex WRITE FORMATS
340 WRITE FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
343 @cmd{WRITE FORMATS} sets the write formats for the specified variables
344 to the specified format specification. Its syntax is identical to
345 that of @cmd{FORMATS} (@pxref{FORMATS}), but @cmd{WRITE FORMATS} sets only
346 write formats, not print formats.
353 FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
356 @cmd{FORMATS} set both print and write formats for the specified
357 variables to the specified format specification.
358 @xref{Input and Output Formats}.
360 Specify a list of variables followed by a format specification in
361 parentheses. The print and write formats of the specified variables
362 will be changed. All of the variables listed together must have
363 the same type and, for string variables, the same width.
365 Additional lists of variables and formats may be included following
368 @cmd{FORMATS} takes effect immediately. It is not affected by
369 conditional and looping structures such as @cmd{DO IF} or @cmd{LOOP}.
372 @section VALUE LABELS
375 The values of a variable can be associated with an arbitrary text string.
376 In this way, a short value can stand for a longer, more descriptive label.
378 Both numeric and string variables can be given labels. For string
379 variables, the values are case-sensitive, so that, for example, a
380 capitalized value and its lowercase variant would have to be labeled
381 separately if both are present in the data.
385 /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
388 @cmd{VALUE LABELS} allows values of variables to be associated with labels.
390 To set up value labels for one or more variables, specify the
391 variable names after a slash (@samp{/}), followed by a list of values
392 and their associated labels, separated by spaces.
394 Value labels in output are normally broken into lines automatically.
395 Put @samp{\n} in a label string to force a line break at that point.
396 The label may still be broken into lines at additional points.
398 Before @cmd{VALUE LABELS} is executed, any existing value labels
399 are cleared from the variables specified. Use @cmd{ADD VALUE LABELS}
400 (@pxref{ADD VALUE LABELS}) to add value labels without clearing those
403 @node ADD VALUE LABELS
404 @section ADD VALUE LABELS
405 @vindex ADD VALUE LABELS
407 @cmd{ADD VALUE LABELS} has the same syntax and purpose as @cmd{VALUE
408 LABELS} (@pxref{VALUE LABELS}), but it does not clear value
409 labels from the variables before adding the ones specified.
413 /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
418 @section MISSING VALUES
419 @vindex MISSING VALUES
421 In many situations the data available for analysis is incomplete and a placeholder
422 must be used in place of a value to indicate that the value is unknown. One way
423 that missing values are represented is through the $SYSMIS variable
424 (@pxref{System Variables}). Another, more flexible way is through
425 @dfn{user-missing values} which are determined on a per variable basis.
427 The @cmd{MISSING VALUES} command sets user-missing values for variables.
430 MISSING VALUES @var{var_list} (@var{missing_values}).
432 where @var{missing_values} takes one of the following forms:
434 @var{num1}, @var{num2}
435 @var{num1}, @var{num2}, @var{num3}
436 @var{num1} THRU @var{num2}
437 @var{num1} THRU @var{num2}, @var{num3}
439 @var{string1}, @var{string2}
440 @var{string1}, @var{string2}, @var{string3}
441 As part of a range, @subcmd{LO} or @subcmd{LOWEST} may take the place of @var{num1};
442 @subcmd{HI} or @subcmd{HIGHEST} may take the place of @var{num2}.
445 @cmd{MISSING VALUES} sets user-missing values for numeric and string
446 variables. Long string variables may have missing values, but
447 characters after the first 8 bytes of the missing value must be
450 Specify a list of variables, followed by a list of their user-missing
451 values in parentheses. Up to three discrete values may be given, or,
452 for numeric variables only, a range of values optionally accompanied by
453 a single discrete value. Ranges may be open-ended on one end, indicated
454 through the use of the
455 keyword @subcmd{LO} or @subcmd{LOWEST} or @subcmd{HI} or @subcmd{HIGHEST}.
457 The @cmd{MISSING VALUES} command takes effect immediately. It is not
458 affected by conditional and looping constructs such as @cmd{DO IF} or
461 @node VARIABLE ATTRIBUTE
462 @section VARIABLE ATTRIBUTE
463 @vindex VARIABLE ATTRIBUTE
465 @cmd{VARIABLE ATTRIBUTE} adds, modifies, or removes user-defined
466 attributes associated with variables in the active dataset. Custom
467 variable attributes are not interpreted by @pspp{}, but they are saved as
468 part of system files and may be used by other software that reads
473 VARIABLES=@var{var_list}
474 ATTRIBUTE=@var{name}('@var{value}') [@var{name}('@var{value}')]@dots{}
475 ATTRIBUTE=@var{name}@b{[}@var{index}@b{]}('@var{value}') [@var{name}@b{[}@var{index}@b{]}('@var{value}')]@dots{}
476 DELETE=@var{name} [@var{name}]@dots{}
477 DELETE=@var{name}@b{[}@var{index}@b{]} [@var{name}@b{[}@var{index}@b{]}]@dots{}
480 The required @subcmd{VARIABLES} subcommand must come first. Specify the
481 variables to which the following @subcmd{ATTRIBUTE} or @subcmd{DELETE} subcommand
484 Use the @subcmd{ATTRIBUTE} subcommand to add or modify custom variable
485 attributes. Specify the name of the attribute as an identifier
486 (@pxref{Tokens}), followed by the desired value, in parentheses, as a
487 quoted string. The specified attributes are then added or modified in
488 the variables specified on @subcmd{VARIABLES}. Attribute names that begin with
489 @code{$} are reserved for @pspp{}'s internal use, and attribute names
490 that begin with @code{@@} or @code{$@@} are not displayed by most @pspp{}
491 commands that display other attributes. Other attribute names are not
494 Attributes may also be organized into arrays. To assign to an array
495 element, add an integer array index enclosed in square brackets
496 (@code{[} and @code{]}) between the attribute name and value. Array
497 indexes start at 1, not 0. An attribute array that has a single
498 element (number 1) is not distinguished from a non-array attribute.
500 Use the @subcmd{DELETE} subcommand to delete an attribute from the variable
501 specified on @subcmd{VARIABLES}. Specify an attribute name by itself to delete
502 an entire attribute, including all array elements for attribute
503 arrays. Specify an attribute name followed by an array index in
504 square brackets to delete a single element of an attribute array. In
505 the latter case, all the array elements numbered higher than the
506 deleted element are shifted down, filling the vacated position.
508 To associate custom attributes with the entire active dataset, instead of
509 with particular variables, use @cmd{DATAFILE ATTRIBUTE} (@pxref{DATAFILE ATTRIBUTE}) instead.
511 @cmd{VARIABLE ATTRIBUTE} takes effect immediately. It is not affected
512 by conditional and looping structures such as @cmd{DO IF} or
515 @node VARIABLE ALIGNMENT
516 @section VARIABLE ALIGNMENT
517 @vindex VARIABLE ALIGNMENT
519 @cmd{VARIABLE ALIGNMENT} sets the alignment of variables for display editing
520 purposes. It does not affect the display of variables in the @pspp{} output.
524 @var{var_list} ( LEFT | RIGHT | CENTER )
525 [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
529 [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
533 @section VARIABLE WIDTH
534 @vindex VARIABLE WIDTH
537 @var{var_list} (width)
538 [ /@var{var_list} (width) ]
542 [ /@var{var_list} (width) ]
545 @cmd{VARIABLE WIDTH} sets the column width of variables for display editing
546 purposes. It does not affect the display of variables in the @pspp{} output.
550 @section VARIABLE LEVEL
551 @vindex VARIABLE LEVEL
553 @t{VARIABLE LEVEL} @i{variables} @t{(}@{@t{SCALE} @math{|} @t{NOMINAL} @math{|} @t{ORDINAL}@}@t{)}@dots{}
556 @cmd{VARIABLE LEVEL} sets the measurement level of @var{variables} as
557 specified. @xref{Attributes}, for the definitions of the available
561 @section VARIABLE ROLE
562 @vindex VARIABLE ROLE
565 /@var{role} @var{var_list}
566 [/@var{role} @var{var_list}]@dots{}
569 @cmd{VARIABLE ROLE} sets the intended role of a variable for use in
570 dialog boxes in graphical user interfaces. Each @var{role} specifies
571 one of the following roles for the variables that follow it:
575 An input variable, such as an independent variable.
578 An output variable, such as an dependent variable.
581 A variable used for input and output.
584 No role assigned. (This is a variable's default role.)
587 Used to break the data into groups for testing.
590 No meaning except for certain third party software. (This role's
591 meaning is unrelated to @cmd{SPLIT FILE}.)
594 The PSPPIRE GUI does not yet use variable roles as intended.
601 Two possible syntaxes:
602 VECTOR @var{vec_name}=@var{var_list}.
603 VECTOR @var{vec_name_list}(@var{count} [@var{format}]).
606 @cmd{VECTOR} allows a group of variables to be accessed as if they
607 were consecutive members of an array with a vector(index) notation.
609 To make a vector out of a set of existing variables, specify a name
610 for the vector followed by an equals sign (@samp{=}) and the variables
611 to put in the vector. The variables must be all numeric or all
612 string, and string variables must have the same width.
614 To make a vector and create variables at the same time, specify one or
615 more vector names followed by a count in parentheses. This will
616 create variables named @code{@var{vec}1} through
617 @code{@var{vec}@var{count}}. By default, the new variables are
618 numeric with format F8.2, but an alternate format may be specified
619 inside the parentheses before or after the count and separated from it
620 by white space or a comma. With a string format such as A8, the
621 variables will be string variables; with a numeric format, they will
622 be numeric. Variable names including the suffixes may not exceed 64
623 characters in length, and none of the variables may exist prior to
626 Vectors created with @cmd{VECTOR} disappear after any procedure or
627 procedure-like command is executed. The variables contained in the
628 vectors remain, unless they are scratch variables (@pxref{Scratch
631 Variables within a vector may be referenced in expressions using
632 @code{vector(index)} syntax.
638 @cmd{MRSETS} creates, modifies, deletes, and displays multiple
639 response sets. A multiple response set is a set of variables that
640 represent multiple responses to a survey question.
642 Multiple responses are represented in one of the two following ways:
646 A @dfn{multiple dichotomy set} is analogous to a survey question with
647 a set of checkboxes. Each variable in the set is treated in a Boolean
648 fashion: one value (the "counted value") means that the box was
649 checked, and any other value means that it was not.
652 A @dfn{multiple category set} represents a survey question where the
653 respondent is instructed to list up to @var{n} choices. Each variable
654 represents one of the responses.
659 /MDGROUP NAME=@var{name} VARIABLES=@var{var_list} VALUE=@var{value}
660 [CATEGORYLABELS=@{VARLABELS,COUNTEDVALUES@}]
661 [@{LABEL='@var{label}',LABELSOURCE=VARLABEL@}]
663 /MCGROUP NAME=@var{name} VARIABLES=@var{var_list} [LABEL='@var{label}']
665 /DELETE NAME=@{[@var{names}],ALL@}
667 /DISPLAY NAME=@{[@var{names}],ALL@}
671 Any number of subcommands may be specified in any order.
673 The @subcmd{MDGROUP} subcommand creates a new multiple dichotomy set or
674 replaces an existing multiple response set. The @subcmd{NAME},
675 @subcmd{VARIABLES}, and
676 @subcmd{VALUE} specifications are required. The others are optional:
680 @var{NAME} specifies the name used in syntax for the new multiple dichotomy
681 set. The name must begin with @samp{$}; it must otherwise follow the
682 rules for identifiers (@pxref{Tokens}).
685 @subcmd{VARIABLES} specifies the variables that belong to the set. At least
686 two variables must be specified. The variables must be all string or
690 @subcmd{VALUE} specifies the counted value. If the variables are numeric, the
691 value must be an integer. If the variables are strings, then the
692 value must be a string that is no longer than the shortest of the
693 variables in the set (ignoring trailing spaces).
696 @subcmd{CATEGORYLABELS} optionally specifies the source of the labels for each
701 @subcmd{VARLABELS}, the default, uses variable labels or, for variables without
702 variable labels, variable names. @pspp{} warns if two variables have the
703 same variable label, since these categories cannot be distinguished in
707 @subcmd{COUNTEDVALUES} instead uses each variable's value label for the counted
708 value. @pspp{} warns if two variables have the same value label for the
709 counted value or if one of the variables lacks a value label, since
710 such categories cannot be distinguished in output.
714 @subcmd{LABEL} optionally specifies a label for the multiple response set. If
715 neither @subcmd{LABEL} nor @subcmd{LABELSOURCE=VARLABEL} is specified, the set is
719 @subcmd{LABELSOURCE=VARLABEL} draws the multiple response set's label from the
720 first variable label among the variables in the set; if none of the
721 variables has a label, the name of the first variable is used.
722 @subcmd{LABELSOURCE=VARLABEL} must be used with @subcmd{CATEGORYLABELS=COUNTEDVALUES}.
723 It is mutually exclusive with @subcmd{LABEL}.
726 The @subcmd{MCGROUP} subcommand creates a new multiple category set or
727 replaces an existing multiple response set. The @subcmd{NAME} and @subcmd{VARIABLES}
728 specifications are required, and @subcmd{LABEL} is optional. Their meanings
729 are as described above in @subcmd{MDGROUP}. @pspp{} warns if two variables in the
730 set have different value labels for a single value, since each of the
731 variables in the set should have the same possible categories.
733 The @subcmd{DELETE} subcommand deletes multiple response groups. A list of
734 groups may be named within a set of required square brackets, or ALL
735 may be used to delete all groups.
737 The @subcmd{DISPLAY} subcommand displays information about defined multiple
738 response sets. Its syntax is the same as the @subcmd{DELETE} subcommand.
740 Multiple response sets are saved to and read from system files by,
741 @i{e.g.}, the @cmd{SAVE} and @cmd{GET} command. Otherwise, multiple
742 response sets are currently used only by third party software.
748 @cmd{LEAVE} prevents the specified variables from being
749 reinitialized whenever a new case is processed.
752 LEAVE @var{var_list}.
755 Normally, when a data file is processed, every variable in the active
756 dataset is initialized to the system-missing value or spaces at the
757 beginning of processing for each case. When a variable has been
758 specified on @cmd{LEAVE}, this is not the case. Instead, that variable is
759 initialized to 0 (not system-missing) or spaces for the first case.
760 After that, it retains its value between cases.
762 This becomes useful for counters. For instance, in the example below
763 the variable @code{SUM} maintains a running total of the values in the @code{ITEM}
768 COMPUTE SUM=SUM+ITEM.
779 @noindent Partial output from this example:
788 It is best to use @cmd{LEAVE} command immediately before invoking a
789 procedure command, because the left status of variables is reset by
790 certain transformations---for instance, @cmd{COMPUTE} and @cmd{IF}.
791 Left status is also reset by all procedure invocations.