f4ed4449dd52aeb713b8fb1959dceb63278b8c07
[pspp] / doc / variables.texi
1 @node Variable Attributes
2 @chapter Manipulating variables
3
4 The variables in the active dataset dictionary are important.  There are
5 several utility functions for examining and adjusting them.
6
7 @menu
8 * ADD VALUE LABELS::            Add value labels to variables.
9 * DELETE VARIABLES::            Delete variables.
10 * DISPLAY::                     Display information about the active dataset.
11 * FORMATS::                     Set print and write formats.
12 * LEAVE::                       Don't clear variables between cases.
13 * MISSING VALUES::              Set missing values for variables.
14 * MODIFY VARS::                 Rename, reorder, and drop variables.
15 * MRSETS::                      Add, modify, and list multiple response sets.
16 * NUMERIC::                     Create new numeric variables.
17 * PRINT FORMATS::               Set variable print formats.
18 * RENAME VARIABLES::            Rename variables.
19 * VALUE LABELS::                Set value labels for variables.
20 * STRING::                      Create new string variables.
21 * VARIABLE ATTRIBUTE::          Set custom attributes on variables.
22 * VARIABLE LABELS::             Set variable labels for variables.
23 * VARIABLE ALIGNMENT::          Set the alignment for display.
24 * VARIABLE WIDTH::              Set the display width.
25 * VARIABLE LEVEL::              Set the measurement level.
26 * VECTOR::                      Declare an array of variables.
27 * WRITE FORMATS::               Set variable write formats.
28 @end menu
29
30 @node ADD VALUE LABELS
31 @section ADD VALUE LABELS
32 @vindex ADD VALUE LABELS
33
34 @display 
35 ADD VALUE LABELS
36         /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
37 @end display
38
39 @cmd{ADD VALUE LABELS} has the same syntax and purpose as @cmd{VALUE
40 LABELS} (@pxref{VALUE LABELS}), but it does not clear value
41 labels from the variables before adding the ones specified.
42
43 @node DELETE VARIABLES
44 @section DELETE VARIABLES
45 @vindex DELETE VARIABLES
46
47 @display
48 DELETE VARIABLES @var{var_list}.
49 @end display
50
51 @cmd{DELETE VARIABLES} deletes the specified variables from the
52 dictionary.  It may not be used to delete all variables from the
53 dictionary; use @cmd{NEW FILE} to do that (@pxref{NEW FILE}).
54
55 @cmd{DELETE VARIABLES} should not be used after defining transformations
56 but before executing a procedure.  If it is used in such a context, it
57 causes the data to be read.  If it is used while @cmd{TEMPORARY} is in
58 effect, it causes the temporary transformations to become permanent.
59
60 @node DISPLAY
61 @section DISPLAY
62 @vindex DISPLAY
63
64 @display
65 DISPLAY [SORTED] NAMES [[/VARIABLES=]@var{var_list}].
66 DISPLAY [SORTED] INDEX [[/VARIABLES=]@var{var_list}].
67 DISPLAY [SORTED] LABELS [[/VARIABLES=]@var{var_list}].
68 DISPLAY [SORTED] VARIABLES [[/VARIABLES=]@var{var_list}].
69 DISPLAY [SORTED] DICTIONARY [[/VARIABLES=]@var{var_list}].
70 DISPLAY [SORTED] SCRATCH [[/VARIABLES=]@var{var_list}].
71 DISPLAY [SORTED] ATTRIBUTES [[/VARIABLES=]@var{var_list}].
72 DISPLAY [SORTED] @@ATTRIBUTES [[/VARIABLES=]@var{var_list}].
73 DISPLAY [SORTED] VECTORS.
74 @end display
75
76 @cmd{DISPLAY} displays information about the active dataset.  A variety
77 of different forms of information can be requested.
78
79 The following keywords primarily cause information about variables to
80 be displayed.  With these keywords, by default information is
81 displayed about all variable in the active dataset, in the order that
82 variables occur in the active dataset dictionary.  The @subcmd{SORTED} keyword
83 causes output to be sorted alphabetically by variable name.  The
84 @subcmd{VARIABLES} subcommand limits output to the specified variables.
85
86 @table @asis
87 @item NAMES
88 The variables' names are displayed.
89
90 @item INDEX
91 The variables' names are displayed along with a value describing their
92 position within the active dataset dictionary.
93
94 @item LABELS
95 Variable names, positions, and variable labels are displayed.
96
97 @item VARIABLES
98 Variable names, positions, print and write formats, and missing values
99 are displayed.
100
101 @item DICTIONARY
102 Variable names, positions, print and write formats, missing values,
103 variable labels, and value labels are displayed.
104
105 @item SCRATCH
106 Variable names are displayed, for scratch variables only (@pxref{Scratch
107 Variables}).
108
109 @item ATTRIBUTES
110 @itemx @@ATTRIBUTES
111 Datafile and variable attributes are displayed.
112 The first form of the command omits those attributes 
113 whose names begin with @code{@@} or @code{$@@}.
114 In the second for, all datafile and variable attributes are displayed.
115 @end table
116
117 With the @code{VECTOR} keyword, @cmd{DISPLAY} lists all the currently
118 declared vectors.  If the @subcmd{SORTED} keyword is given, the vectors are
119 listed in alphabetical order; otherwise, they are listed in textual
120 order of definition within the @pspp{} syntax file.
121
122 For related commands, see @ref{DISPLAY DOCUMENTS} and @ref{DISPLAY
123 FILE LABEL}.
124
125 @node FORMATS
126 @section FORMATS
127 @vindex FORMATS
128
129 @display
130 FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
131 @end display
132
133 @cmd{FORMATS} set both print and write formats for the specified
134 variables to the specified format specification.
135 @xref{Input and Output Formats}.
136
137 Specify a list of variables followed by a format specification in
138 parentheses.  The print and write formats of the specified variables
139 will be changed.  All of the variables listed together must have
140 the same type and, for string variables, the same width.
141
142 Additional lists of variables and formats may be included following
143 the first one.
144
145 @cmd{FORMATS} takes effect immediately.  It is not affected by
146 conditional and looping structures such as @cmd{DO IF} or @cmd{LOOP}.
147
148 @node LEAVE
149 @section LEAVE
150 @vindex LEAVE
151
152 @display
153 LEAVE @var{var_list}.
154 @end display
155
156 @cmd{LEAVE} prevents the specified variables from being
157 reinitialized whenever a new case is processed.
158
159 Normally, when a data file is processed, every variable in the active
160 dataset is initialized to the system-missing value or spaces at the
161 beginning of processing for each case.  When a variable has been
162 specified on @cmd{LEAVE}, this is not the case.  Instead, that variable is
163 initialized to 0 (not system-missing) or spaces for the first case.
164 After that, it retains its value between cases.
165
166 This becomes useful for counters.  For instance, in the example below
167 the variable @code{SUM} maintains a running total of the values in the @code{ITEM}
168 variable.
169
170 @example
171 DATA LIST /ITEM 1-3.
172 COMPUTE SUM=SUM+ITEM.
173 PRINT /ITEM SUM.
174 LEAVE SUM
175 BEGIN DATA.
176 123
177 404
178 555
179 999
180 END DATA.
181 @end example
182
183 @noindent Partial output from this example:
184
185 @example
186 123   123.00
187 404   527.00
188 555  1082.00
189 999  2081.00
190 @end example
191
192 It is best to use @cmd{LEAVE} command immediately before invoking a
193 procedure command, because the left status of variables is reset by
194 certain transformations---for instance, @cmd{COMPUTE} and @cmd{IF}.
195 Left status is also reset by all procedure invocations.
196
197 @node MISSING VALUES
198 @section MISSING VALUES
199 @vindex MISSING VALUES
200
201 @display
202 MISSING VALUES @var{var_list} (@var{missing_values}).
203
204 where @var{missing_values} takes one of the following forms:
205         @var{num1}
206         @var{num1}, @var{num2}
207         @var{num1}, @var{num2}, @var{num3}
208         @var{num1} THRU @var{num2}
209         @var{num1} THRU @var{num2}, @var{num3}
210         @var{string1}
211         @var{string1}, @var{string2}
212         @var{string1}, @var{string2}, @var{string3}
213 As part of a range, @subcmd{LO} or @subcmd{LOWEST} may take the place of @var{num1};
214 @subcmd{HI} or @subcmd{HIGHEST} may take the place of @var{num2}.
215 @end display
216
217 @cmd{MISSING VALUES} sets user-missing values for numeric and string
218 variables.  Long string variables may have missing values, but
219 characters after the first 8 bytes of the missing value must be
220 spaces.
221
222 Specify a list of variables, followed by a list of their user-missing
223 values in parentheses.  Up to three discrete values may be given, or,
224 for numeric variables only, a range of values optionally accompanied by
225 a single discrete value.  Ranges may be open-ended on one end, indicated
226 through the use of the 
227 keyword @subcmd{LO} or @subcmd{LOWEST} or @subcmd{HI} or @subcmd{HIGHEST}.
228
229 The @cmd{MISSING VALUES} command takes effect immediately.  It is not
230 affected by conditional and looping constructs such as @cmd{DO IF} or
231 @cmd{LOOP}.
232
233 @node MODIFY VARS
234 @section MODIFY VARS
235 @vindex MODIFY VARS
236
237 @display 
238 MODIFY VARS
239         /REORDER=@{FORWARD,BACKWARD@} @{POSITIONAL,ALPHA@} (@var{var_list})@dots{}
240         /RENAME=(@var{old_names}=@var{new_names})@dots{}
241         /@{DROP,KEEP@}=@var{var_list}
242         /MAP    
243 @end display
244
245 @cmd{MODIFY VARS} reorders, renames, and deletes variables in the
246 active dataset.
247
248 At least one subcommand must be specified, and no subcommand may be
249 specified more than once.  @subcmd{DROP} and @subcmd{KEEP} may not both
250 be specified.
251
252 The @subcmd{REORDER} subcommand changes the order of variables in the active
253 dataset.  Specify one or more lists of variable names in parentheses.  By
254 default, each list of variables is rearranged into the specified order.
255 To put the variables into the reverse of the specified order, put
256 keyword @subcmd{BACKWARD} before the parentheses.  To put them into alphabetical
257 order in the dictionary, specify keyword @subcmd{ALPHA} before the parentheses.
258 @subcmd{BACKWARD} and @subcmd{ALPHA} may also be combined.
259
260 To rename variables in the active dataset, specify @subcmd{RENAME}, an equals sign
261 (@samp{=}), and lists of the old variable names and new variable names
262 separated by another equals sign within parentheses.  There must be the
263 same number of old and new variable names.  Each old variable is renamed to
264 the corresponding new variable name.  Multiple parenthesized groups of
265 variables may be specified.
266
267 The @subcmd{DROP} subcommand deletes a specified list of variables from the
268 active dataset.
269
270 The @subcmd{KEEP} subcommand keeps the specified list of variables in the active
271 dataset.  Any unlisted variables are deleted from the active dataset.
272
273 @subcmd{MAP} is currently ignored.
274
275 If either @subcmd{DROP} or @subcmd{KEEP} is specified, the data is read;
276 otherwise it is not.
277
278 @cmd{MODIFY VARS} may not be specified following @cmd{TEMPORARY}
279 (@pxref{TEMPORARY}).
280
281 @node MRSETS
282 @section MRSETS
283 @vindex MRSETS
284
285 @display
286 MRSETS 
287     /MDGROUP NAME=@var{name} VARIABLES=@var{var_list} VALUE=@var{value}
288      [CATEGORYLABELS=@{VARLABELS,COUNTEDVALUES@}]
289      [@{LABEL='@var{label}',LABELSOURCE=VARLABEL@}]
290
291     /MCGROUP NAME=@var{name} VARIABLES=@var{var_list} [LABEL='@var{label}']
292
293     /DELETE NAME=@{[@var{names}],ALL@}
294
295     /DISPLAY NAME=@{[@var{names}],ALL@}
296 @end display
297
298 @cmd{MRSETS} creates, modifies, deletes, and displays multiple
299 response sets.  A multiple response set is a set of variables that
300 represent multiple responses to a single survey question in one of the
301 two following ways:
302
303 @itemize @bullet
304 @item
305 A @dfn{multiple dichotomy set} is analogous to a survey question with
306 a set of checkboxes.  Each variable in the set is treated in a Boolean
307 fashion: one value (the "counted value") means that the box was
308 checked, and any other value means that it was not.
309
310 @item
311 A @dfn{multiple category set} represents a survey question where the
312 respondent is instructed to list up to @var{n} choices.  Each variable
313 represents one of the responses.
314 @end itemize
315
316 Any number of subcommands may be specified in any order.
317
318 The @subcmd{MDGROUP} subcommand creates a new multiple dichotomy set or
319 replaces an existing multiple response set.  The @subcmd{NAME},
320 @subcmd{VARIABLES}, and
321 @subcmd{VALUE} specifications are required.  The others are optional:
322
323 @itemize @bullet
324 @item
325 @var{NAME} specifies the name used in syntax for the new multiple dichotomy
326 set.  The name must begin with @samp{$}; it must otherwise follow the
327 rules for identifiers (@pxref{Tokens}).
328
329 @item
330 @subcmd{VARIABLES} specifies the variables that belong to the set.  At least
331 two variables must be specified.  The variables must be all string or
332 all numeric.
333
334 @item
335 @subcmd{VALUE} specifies the counted value.  If the variables are numeric, the
336 value must be an integer.  If the variables are strings, then the
337 value must be a string that is no longer than the shortest of the
338 variables in the set (ignoring trailing spaces).
339
340 @item
341 @subcmd{CATEGORYLABELS} optionally specifies the source of the labels for each
342 category in the set:
343
344 @itemize @minus
345 @item
346 @subcmd{VARLABELS}, the default, uses variable labels or, for variables without
347 variable labels, variable names.  @pspp{} warns if two variables have the
348 same variable label, since these categories cannot be distinguished in
349 output.
350
351 @item 
352 @subcmd{COUNTEDVALUES} instead uses each variable's value label for the counted
353 value.  @pspp{} warns if two variables have the same value label for the
354 counted value or if one of the variables lacks a value label, since
355 such categories cannot be distinguished in output.
356 @end itemize
357
358 @item
359 @subcmd{LABEL} optionally specifies a label for the multiple response set.  If
360 neither @subcmd{LABEL} nor @subcmd{LABELSOURCE=VARLABEL} is specified, the set is
361 unlabeled.
362
363 @item
364 @subcmd{LABELSOURCE=VARLABEL} draws the multiple response set's label from the
365 first variable label among the variables in the set; if none of the
366 variables has a label, the name of the first variable is used.
367 @subcmd{LABELSOURCE=VARLABEL} must be used with @subcmd{CATEGORYLABELS=COUNTEDVALUES}.
368 It is mutually exclusive with @subcmd{LABEL}.
369 @end itemize
370
371 The @subcmd{MCGROUP} subcommand creates a new multiple category set or
372 replaces an existing multiple response set.  The @subcmd{NAME} and @subcmd{VARIABLES}
373 specifications are required, and @subcmd{LABEL} is optional.  Their meanings
374 are as described above in @subcmd{MDGROUP}.  @pspp{} warns if two variables in the
375 set have different value labels for a single value, since each of the
376 variables in the set should have the same possible categories.
377
378 The @subcmd{DELETE} subcommand deletes multiple response groups.  A list of
379 groups may be named within a set of required square brackets, or ALL
380 may be used to delete all groups.
381
382 The @subcmd{DISPLAY} subcommand displays information about defined multiple
383 response sets.  Its syntax is the same as the @subcmd{DELETE} subcommand.
384
385 Multiple response sets are saved to and read from system files by,
386 e.g., the @cmd{SAVE} and @cmd{GET} command.  Otherwise, multiple
387 response sets are currently used only by third party software.
388
389 @node NUMERIC
390 @section NUMERIC
391 @vindex NUMERIC
392
393 @display
394 NUMERIC /@var{var_list} [(@var{fmt_spec})].
395 @end display
396
397 @cmd{NUMERIC} explicitly declares new numeric variables, optionally
398 setting their output formats.
399
400 Specify a slash (@samp{/}), followed by the names of the new numeric
401 variables.  If you wish to set their output formats, follow their names
402 by an output format specification in parentheses (@pxref{Input and Output
403 Formats}); otherwise, the default is F8.2.
404
405 Variables created with @cmd{NUMERIC} are initialized to the
406 system-missing value.
407
408 @node PRINT FORMATS
409 @section PRINT FORMATS
410 @vindex PRINT FORMATS
411
412 @display
413 PRINT FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
414 @end display
415
416 @cmd{PRINT FORMATS} sets the print formats for the specified
417 variables to the specified format specification.
418
419 Its syntax is identical to that of @cmd{FORMATS} (@pxref{FORMATS}),
420 but @cmd{PRINT FORMATS} sets only print formats, not write formats.
421
422 @node RENAME VARIABLES
423 @section RENAME VARIABLES
424 @vindex RENAME VARIABLES
425
426 @display
427 RENAME VARIABLES (@var{old_names}=@var{new_names})@dots{} .
428 @end display
429
430 @cmd{RENAME VARIABLES} changes the names of variables in the active
431 dataset.  Specify lists of the old variable names and new
432 variable names, separated by an equals sign (@samp{=}), within
433 parentheses.  There must be the same number of old and new variable
434 names.  Each old variable is renamed to the corresponding new variable
435 name.  Multiple parenthesized groups of variables may be specified.
436
437 @cmd{RENAME VARIABLES} takes effect immediately.  It does not cause the data
438 to be read.
439
440 @cmd{RENAME VARIABLES} may not be specified following @cmd{TEMPORARY}
441 (@pxref{TEMPORARY}).
442
443 @node VALUE LABELS
444 @section VALUE LABELS
445 @vindex VALUE LABELS
446
447 @display 
448 VALUE LABELS
449         /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
450 @end display
451
452 @cmd{VALUE LABELS} allows values of numeric and short string
453 variables to be associated with labels.  In this way, a short value can
454 stand for a long value.
455
456 To set up value labels for a set of variables, specify the
457 variable names after a slash (@samp{/}), followed by a list of values
458 and their associated labels, separated by spaces.
459
460 Value labels in output are normally broken into lines automatically.
461 Put @samp{\n} in a label string to force a line break at that point.
462 The label may still be broken into lines at additional points.
463
464 Before @cmd{VALUE LABELS} is executed, any existing value labels
465 are cleared from the variables specified.  Use @cmd{ADD VALUE LABELS}
466 (@pxref{ADD VALUE LABELS}) to add value labels without clearing those
467 already present.
468
469 @node STRING
470 @section STRING
471 @vindex STRING
472
473 @display
474 STRING @var{var_list} (@var{fmt_spec}) [/@var{var_list} (@var{fmt_spec})] [@dots{}].
475 @end display
476
477 @cmd{STRING} creates new string variables for use in
478 transformations.
479
480 Specify a list of names for the variable you want to create,
481 followed by the desired output format specification in
482 parentheses (@pxref{Input and Output Formats}).  
483 Variable widths are
484 implicitly derived from the specified output formats.
485 The created variables will be initialized to spaces.
486
487 If you want to create several variables with  distinct
488 output formats, you can either use two or more separate @cmd{STRING} commands,
489 or you can specify further variable list and format specification pairs, each separated
490 from the previous by a slash (@samp{/}).
491
492 The following example is one way to create three string variables; Two of the
493 variables have format A24 and the other A80:
494 @example
495 STRING firstname lastname (A24) / address (A80).
496 @end example
497
498 @noindent Here is another way to achieve the same result:
499 @example
500 STRING firstname lastname (A24).
501 STRING address (A80).
502 @end example
503
504 @noindent @dots{} and here is yet another way:
505
506 @example
507 STRING firstname (A24).
508 STRING lastname (A24).
509 STRING address (A80).
510 @end example
511
512
513
514
515 @node VARIABLE ATTRIBUTE
516 @section VARIABLE ATTRIBUTE
517 @vindex VARIABLE ATTRIBUTE
518
519 @display
520 VARIABLE ATTRIBUTE
521          VARIABLES=@var{var_list}
522          ATTRIBUTE=@var{name}('@var{value}') [@var{name}('@var{value}')]@dots{}
523          ATTRIBUTE=@var{name}@b{[}@var{index}@b{]}('@var{value}') [@var{name}@b{[}@var{index}@b{]}('@var{value}')]@dots{}
524          DELETE=@var{name} [@var{name}]@dots{}
525          DELETE=@var{name}@b{[}@var{index}@b{]} [@var{name}@b{[}@var{index}@b{]}]@dots{}
526 @end display
527
528 @cmd{VARIABLE ATTRIBUTE} adds, modifies, or removes user-defined
529 attributes associated with variables in the active dataset.  Custom
530 variable attributes are not interpreted by @pspp{}, but they are saved as
531 part of system files and may be used by other software that reads
532 them.
533
534 The required @subcmd{VARIABLES} subcommand must come first.  Specify the
535 variables to which the following @subcmd{ATTRIBUTE} or @subcmd{DELETE} subcommand
536 should apply.
537
538 Use the @subcmd{ATTRIBUTE} subcommand to add or modify custom variable
539 attributes.  Specify the name of the attribute as an identifier
540 (@pxref{Tokens}), followed by the desired value, in parentheses, as a
541 quoted string.  The specified attributes are then added or modified in
542 the variables specified on @subcmd{VARIABLES}.  Attribute names that begin with
543 @code{$} are reserved for @pspp{}'s internal use, and attribute names
544 that begin with @code{@@} or @code{$@@} are not displayed by most @pspp{}
545 commands that display other attributes.  Other attribute names are not
546 treated specially.
547
548 Attributes may also be organized into arrays.  To assign to an array
549 element, add an integer array index enclosed in square brackets
550 (@code{[} and @code{]}) between the attribute name and value.  Array
551 indexes start at 1, not 0.  An attribute array that has a single
552 element (number 1) is not distinguished from a non-array attribute.
553
554 Use the @subcmd{DELETE} subcommand to delete an attribute from the variable
555 specified on @subcmd{VARIABLES}.  Specify an attribute name by itself to delete
556 an entire attribute, including all array elements for attribute
557 arrays.  Specify an attribute name followed by an array index in
558 square brackets to delete a single element of an attribute array.  In
559 the latter case, all the array elements numbered higher than the
560 deleted element are shifted down, filling the vacated position.
561
562 To associate custom attributes with the entire active dataset, instead of
563 with particular variables, use @cmd{DATAFILE ATTRIBUTE} (@pxref{DATAFILE ATTRIBUTE}) instead.
564
565 @cmd{VARIABLE ATTRIBUTE} takes effect immediately.  It is not affected
566 by conditional and looping structures such as @cmd{DO IF} or
567 @cmd{LOOP}.
568
569 @node VARIABLE LABELS
570 @section VARIABLE LABELS
571 @vindex VARIABLE LABELS
572
573 @display
574 VARIABLE LABELS
575         @var{var_list} '@var{var_label}' 
576         [ /@var{var_list} '@var{var_label}']
577         .
578         .
579         .
580         [ /@var{var_list} '@var{var_label}']
581 @end display
582
583 @cmd{VARIABLE LABELS} associates explanatory names
584 with variables.  This name, called a @dfn{variable label}, is displayed by
585 statistical procedures.
586
587 To assign a variable label to a group of variables, specify a 
588 list of variable names and the variable label as a string.
589 To assign different labels to different variables in the same command, 
590 precede the subsequent variable list with a slash (@samp{/}).
591
592
593 @node VARIABLE ALIGNMENT
594 @section VARIABLE ALIGNMENT
595 @vindex VARIABLE ALIGNMENT
596
597 @display
598 VARIABLE ALIGNMENT
599         @var{var_list} ( LEFT | RIGHT | CENTER )
600         [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
601         .
602         .
603         .
604         [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
605 @end display
606
607 @cmd{VARIABLE ALIGNMENT} sets the alignment of variables for display editing 
608 purposes.   This only has effect for third party software.  It does not affect 
609 the display of variables in the @pspp{} output.
610
611
612
613
614 @node VARIABLE WIDTH
615 @section VARIABLE WIDTH
616 @vindex VARIABLE WIDTH
617 @display
618 VARIABLE WIDTH
619         @var{var_list} (width)
620         [ /@var{var_list} (width) ] 
621         .
622         .
623         .
624         [ /@var{var_list} (width) ] 
625 @end display
626
627 @cmd{VARIABLE WIDTH} sets the column width of variables for display editing
628 purposes.   This only affects third party software.  It does not affect 
629 the display of variables in the @pspp{} output.
630
631
632 @node VARIABLE LEVEL
633 @section VARIABLE LEVEL
634 @vindex VARIABLE LEVEL
635 @display
636 VARIABLE LEVEL
637         @var{var_list} ( SCALE | NOMINAL | ORDINAL )
638         [ /@var{var_list} ( SCALE | NOMINAL | ORDINAL ) ]
639         .
640         .
641         .
642         [ /@var{var_list} ( SCALE | NOMINAL | ORDINAL ) ]
643 @end display
644
645 @cmd{VARIABLE LEVEL} sets the measurement level of  variables.
646 Currently, this has no effect except for certain third party software.
647
648
649 @node VECTOR
650 @section VECTOR
651 @vindex VECTOR
652
653 @display
654 Two possible syntaxes:
655         VECTOR @var{vec_name}=@var{var_list}.
656         VECTOR @var{vec_name_list}(@var{count} [@var{format}]).
657 @end display
658
659 @cmd{VECTOR} allows a group of variables to be accessed as if they
660 were consecutive members of an array with a vector(index) notation.
661
662 To make a vector out of a set of existing variables, specify a name
663 for the vector followed by an equals sign (@samp{=}) and the variables
664 to put in the vector.  All the variables in the vector must be the same
665 type.  String variables in a vector must all have the same width.
666
667 To make a vector and create variables at the same time, specify one or
668 more vector names followed by a count in parentheses.  This will cause
669 variables named @code{@var{vec}1} through @code{@var{vec}@var{count}}
670 to be created as numeric variables.  By default, the new variables
671 have print and write format F8.2, but an alternate format may be
672 specified inside the parentheses before or after the count and
673 separated from it by white space or a comma.  Variable names including
674 numeric suffixes may not exceed 64 characters in length, and none of
675 the variables may exist prior to @cmd{VECTOR}.
676
677 Vectors created with @cmd{VECTOR} disappear after any procedure or
678 procedure-like command is executed.  The variables contained in the
679 vectors remain, unless they are scratch variables (@pxref{Scratch
680 Variables}).
681
682 Variables within a vector may be referenced in expressions using
683 @code{vector(index)} syntax.
684
685 @node WRITE FORMATS
686 @section WRITE FORMATS
687 @vindex WRITE FORMATS
688
689 @display
690 WRITE FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
691 @end display
692
693 @cmd{WRITE FORMATS} sets the write formats for the specified variables
694 to the specified format specification.  Its syntax is identical to
695 that of @cmd{FORMATS} (@pxref{FORMATS}), but @cmd{WRITE FORMATS} sets only
696 write formats, not print formats.