pivot table procedure conceptually works
[pspp] / doc / variables.texi
index cc73470fd559477867416d64d7b774e2ff8f3fa6..1db8f034a66fc79c5334addb348e6baed606d92f 100644 (file)
@@ -23,6 +23,7 @@ several utility functions for examining and adjusting them.
 * VARIABLE ALIGNMENT::          Set the alignment for display.
 * VARIABLE WIDTH::              Set the display width.
 * VARIABLE LEVEL::              Set the measurement level.
+* VARIABLE ROLE::               Set the role that a variable fills in analysis.
 * VECTOR::                      Declare an array of variables.
 * WRITE FORMATS::               Set variable write formats.
 @end menu
@@ -33,7 +34,7 @@ several utility functions for examining and adjusting them.
 
 @display 
 ADD VALUE LABELS
-        /var_list value 'label' [value 'label']@dots{}
+        /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
 @end display
 
 @cmd{ADD VALUE LABELS} has the same syntax and purpose as @cmd{VALUE
@@ -45,15 +46,15 @@ labels from the variables before adding the ones specified.
 @vindex DELETE VARIABLES
 
 @display
-DELETE VARIABLES var_list.
+DELETE VARIABLES @var{var_list}.
 @end display
 
 @cmd{DELETE VARIABLES} deletes the specified variables from the
 dictionary.  It may not be used to delete all variables from the
 dictionary; use @cmd{NEW FILE} to do that (@pxref{NEW FILE}).
 
-@cmd{DELETE VARIABLES} should not used after defining transformations
-and before executing a procedure.  If it is used in such a context, it
+@cmd{DELETE VARIABLES} should not be used after defining transformations
+but before executing a procedure.  If it is used in such a context, it
 causes the data to be read.  If it is used while @cmd{TEMPORARY} is in
 effect, it causes the temporary transformations to become permanent.
 
@@ -62,14 +63,14 @@ effect, it causes the temporary transformations to become permanent.
 @vindex DISPLAY
 
 @display
-DISPLAY [SORTED] NAMES [[/VARIABLES=]var_list].
-DISPLAY [SORTED] INDEX [[/VARIABLES=]var_list].
-DISPLAY [SORTED] LABELS [[/VARIABLES=]var_list].
-DISPLAY [SORTED] VARIABLES [[/VARIABLES=]var_list].
-DISPLAY [SORTED] DICTIONARY [[/VARIABLES=]var_list].
-DISPLAY [SORTED] SCRATCH [[/VARIABLES=]var_list].
-DISPLAY [SORTED] ATTRIBUTES [[/VARIABLES=]var_list].
-DISPLAY [SORTED] @@ATTRIBUTES [[/VARIABLES=]var_list].
+DISPLAY [SORTED] NAMES [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] INDEX [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] LABELS [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] VARIABLES [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] DICTIONARY [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] SCRATCH [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] ATTRIBUTES [[/VARIABLES=]@var{var_list}].
+DISPLAY [SORTED] @@ATTRIBUTES [[/VARIABLES=]@var{var_list}].
 DISPLAY [SORTED] VECTORS.
 @end display
 
@@ -79,9 +80,9 @@ of different forms of information can be requested.
 The following keywords primarily cause information about variables to
 be displayed.  With these keywords, by default information is
 displayed about all variable in the active dataset, in the order that
-variables occur in the active dataset dictionary.  The SORTED keyword
+variables occur in the active dataset dictionary.  The @subcmd{SORTED} keyword
 causes output to be sorted alphabetically by variable name.  The
-VARIABLES subcommand limits output to the specified variables.
+@subcmd{VARIABLES} subcommand limits output to the specified variables.
 
 @table @asis
 @item NAMES
@@ -107,17 +108,17 @@ Variable names are displayed, for scratch variables only (@pxref{Scratch
 Variables}).
 
 @item ATTRIBUTES
-Datafile and variable attributes are displayed, except that attributes
-whose names begin with @code{@@} or @code{$@@} are omitted.
-
 @itemx @@ATTRIBUTES
-All datafile and variable attributes are displayed.
+Datafile and variable attributes are displayed.
+The first form of the command omits those attributes 
+whose names begin with @code{@@} or @code{$@@}.
+In the second for, all datafile and variable attributes are displayed.
 @end table
 
 With the @code{VECTOR} keyword, @cmd{DISPLAY} lists all the currently
-declared vectors.  If the SORTED keyword is given, the vectors are
+declared vectors.  If the @subcmd{SORTED} keyword is given, the vectors are
 listed in alphabetical order; otherwise, they are listed in textual
-order of definition within the PSPP syntax file.
+order of definition within the @pspp{} syntax file.
 
 For related commands, see @ref{DISPLAY DOCUMENTS} and @ref{DISPLAY
 FILE LABEL}.
@@ -127,7 +128,7 @@ FILE LABEL}.
 @vindex FORMATS
 
 @display
-FORMATS var_list (fmt_spec) [var_list (fmt_spec)]@dots{}.
+FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
 @end display
 
 @cmd{FORMATS} set both print and write formats for the specified
@@ -150,7 +151,7 @@ conditional and looping structures such as @cmd{DO IF} or @cmd{LOOP}.
 @vindex LEAVE
 
 @display
-LEAVE var_list.
+LEAVE @var{var_list}.
 @end display
 
 @cmd{LEAVE} prevents the specified variables from being
@@ -164,7 +165,7 @@ initialized to 0 (not system-missing) or spaces for the first case.
 After that, it retains its value between cases.
 
 This becomes useful for counters.  For instance, in the example below
-the variable SUM maintains a running total of the values in the ITEM
+the variable @code{SUM} maintains a running total of the values in the @code{ITEM}
 variable.
 
 @example
@@ -199,19 +200,19 @@ Left status is also reset by all procedure invocations.
 @vindex MISSING VALUES
 
 @display
-MISSING VALUES var_list (missing_values).
-
-missing_values takes one of the following forms:
-        num1
-        num1, num2
-        num1, num2, num3
-        num1 THRU num2
-        num1 THRU num2, num3
-        string1
-        string1, string2
-        string1, string2, string3
-As part of a range, LO or LOWEST may take the place of num1;
-HI or HIGHEST may take the place of num2.
+MISSING VALUES @var{var_list} (@var{missing_values}).
+
+where @var{missing_values} takes one of the following forms:
+        @var{num1}
+        @var{num1}, @var{num2}
+        @var{num1}, @var{num2}, @var{num3}
+        @var{num1} THRU @var{num2}
+        @var{num1} THRU @var{num2}, @var{num3}
+        @var{string1}
+        @var{string1}, @var{string2}
+        @var{string1}, @var{string2}, @var{string3}
+As part of a range, @subcmd{LO} or @subcmd{LOWEST} may take the place of @var{num1};
+@subcmd{HI} or @subcmd{HIGHEST} may take the place of @var{num2}.
 @end display
 
 @cmd{MISSING VALUES} sets user-missing values for numeric and string
@@ -223,7 +224,8 @@ Specify a list of variables, followed by a list of their user-missing
 values in parentheses.  Up to three discrete values may be given, or,
 for numeric variables only, a range of values optionally accompanied by
 a single discrete value.  Ranges may be open-ended on one end, indicated
-through the use of the keyword LO or LOWEST or HI or HIGHEST.
+through the use of the 
+keyword @subcmd{LO} or @subcmd{LOWEST} or @subcmd{HI} or @subcmd{HIGHEST}.
 
 The @cmd{MISSING VALUES} command takes effect immediately.  It is not
 affected by conditional and looping constructs such as @cmd{DO IF} or
@@ -235,9 +237,9 @@ affected by conditional and looping constructs such as @cmd{DO IF} or
 
 @display 
 MODIFY VARS
-        /REORDER=@{FORWARD,BACKWARD@} @{POSITIONAL,ALPHA@} (var_list)@dots{}
-        /RENAME=(old_names=new_names)@dots{}
-        /@{DROP,KEEP@}=var_list
+        /REORDER=@{FORWARD,BACKWARD@} @{POSITIONAL,ALPHA@} (@var{var_list})@dots{}
+        /RENAME=(@var{old_names}=@var{new_names})@dots{}
+        /@{DROP,KEEP@}=@var{var_list}
         /MAP    
 @end display
 
@@ -245,33 +247,34 @@ MODIFY VARS
 active dataset.
 
 At least one subcommand must be specified, and no subcommand may be
-specified more than once.  DROP and KEEP may not both be specified.
+specified more than once.  @subcmd{DROP} and @subcmd{KEEP} may not both
+be specified.
 
-The REORDER subcommand changes the order of variables in the active
+The @subcmd{REORDER} subcommand changes the order of variables in the active
 dataset.  Specify one or more lists of variable names in parentheses.  By
 default, each list of variables is rearranged into the specified order.
 To put the variables into the reverse of the specified order, put
-keyword BACKWARD before the parentheses.  To put them into alphabetical
-order in the dictionary, specify keyword ALPHA before the parentheses.
-BACKWARD and ALPHA may also be combined.
+keyword @subcmd{BACKWARD} before the parentheses.  To put them into alphabetical
+order in the dictionary, specify keyword @subcmd{ALPHA} before the parentheses.
+@subcmd{BACKWARD} and @subcmd{ALPHA} may also be combined.
 
-To rename variables in the active dataset, specify RENAME, an equals sign
+To rename variables in the active dataset, specify @subcmd{RENAME}, an equals sign
 (@samp{=}), and lists of the old variable names and new variable names
 separated by another equals sign within parentheses.  There must be the
 same number of old and new variable names.  Each old variable is renamed to
 the corresponding new variable name.  Multiple parenthesized groups of
 variables may be specified.
 
-The DROP subcommand deletes a specified list of variables from the
+The @subcmd{DROP} subcommand deletes a specified list of variables from the
 active dataset.
 
-The KEEP subcommand keeps the specified list of variables in the active
+The @subcmd{KEEP} subcommand keeps the specified list of variables in the active
 dataset.  Any unlisted variables are deleted from the active dataset.
 
-MAP is currently ignored.
+@subcmd{MAP} is currently ignored.
 
-If either DROP or KEEP is specified, the data is read; otherwise it is
-not.
+If either @subcmd{DROP} or @subcmd{KEEP} is specified, the data is read;
+otherwise it is not.
 
 @cmd{MODIFY VARS} may not be specified following @cmd{TEMPORARY}
 (@pxref{TEMPORARY}).
@@ -282,15 +285,15 @@ not.
 
 @display
 MRSETS 
-    /MDGROUP NAME=name VARIABLES=var_list VALUE=value
+    /MDGROUP NAME=@var{name} VARIABLES=@var{var_list} VALUE=@var{value}
      [CATEGORYLABELS=@{VARLABELS,COUNTEDVALUES@}]
-     [@{LABEL='label',LABELSOURCE=VARLABEL@}]
+     [@{LABEL='@var{label}',LABELSOURCE=VARLABEL@}]
 
-    /MCGROUP NAME=name VARIABLES=var_list [LABEL='label']
+    /MCGROUP NAME=@var{name} VARIABLES=@var{var_list} [LABEL='@var{label}']
 
-    /DELETE NAME=@{[names],ALL@}
+    /DELETE NAME=@{[@var{names}],ALL@}
 
-    /DISPLAY NAME=@{[names],ALL@}
+    /DISPLAY NAME=@{[@var{names}],ALL@}
 @end display
 
 @cmd{MRSETS} creates, modifies, deletes, and displays multiple
@@ -313,71 +316,72 @@ represents one of the responses.
 
 Any number of subcommands may be specified in any order.
 
-The MDGROUP subcommand creates a new multiple dichotomy set or
-replaces an existing multiple response set.  The NAME, VARIABLES, and
-VALUE specifications are required.  The others are optional:
+The @subcmd{MDGROUP} subcommand creates a new multiple dichotomy set or
+replaces an existing multiple response set.  The @subcmd{NAME},
+@subcmd{VARIABLES}, and
+@subcmd{VALUE} specifications are required.  The others are optional:
 
 @itemize @bullet
 @item
-NAME specifies the name used in syntax for the new multiple dichotomy
+@var{NAME} specifies the name used in syntax for the new multiple dichotomy
 set.  The name must begin with @samp{$}; it must otherwise follow the
 rules for identifiers (@pxref{Tokens}).
 
 @item
-VARIABLES specifies the variables that belong to the set.  At least
+@subcmd{VARIABLES} specifies the variables that belong to the set.  At least
 two variables must be specified.  The variables must be all string or
 all numeric.
 
 @item
-VALUE specifies the counted value.  If the variables are numeric, the
+@subcmd{VALUE} specifies the counted value.  If the variables are numeric, the
 value must be an integer.  If the variables are strings, then the
 value must be a string that is no longer than the shortest of the
 variables in the set (ignoring trailing spaces).
 
 @item
-CATEGORYLABELS optionally specifies the source of the labels for each
+@subcmd{CATEGORYLABELS} optionally specifies the source of the labels for each
 category in the set:
 
 @itemize @minus
 @item
-VARLABELS, the default, uses variable labels or, for variables without
-variable labels, variable names.  PSPP warns if two variables have the
+@subcmd{VARLABELS}, the default, uses variable labels or, for variables without
+variable labels, variable names.  @pspp{} warns if two variables have the
 same variable label, since these categories cannot be distinguished in
 output.
 
 @item 
-COUNTEDVALUES instead uses each variable's value label for the counted
-value.  PSPP warns if two variables have the same value label for the
+@subcmd{COUNTEDVALUES} instead uses each variable's value label for the counted
+value.  @pspp{} warns if two variables have the same value label for the
 counted value or if one of the variables lacks a value label, since
 such categories cannot be distinguished in output.
 @end itemize
 
 @item
-LABEL optionally specifies a label for the multiple response set.  If
-neither LABEL nor LABELSOURCE=VARLABEL is specified, the set is
+@subcmd{LABEL} optionally specifies a label for the multiple response set.  If
+neither @subcmd{LABEL} nor @subcmd{LABELSOURCE=VARLABEL} is specified, the set is
 unlabeled.
 
 @item
-LABELSOURCE=VARLABEL draws the multiple response set's label from the
+@subcmd{LABELSOURCE=VARLABEL} draws the multiple response set's label from the
 first variable label among the variables in the set; if none of the
 variables has a label, the name of the first variable is used.
-LABELSOURCE=VARLABEL must be used with CATEGORYLABELS=COUNTEDVALUES.
-It is mutually exclusive with LABEL.
+@subcmd{LABELSOURCE=VARLABEL} must be used with @subcmd{CATEGORYLABELS=COUNTEDVALUES}.
+It is mutually exclusive with @subcmd{LABEL}.
 @end itemize
 
-The MCGROUP subcommand creates a new multiple category set or
-replaces an existing multiple response set.  The NAME and VARIABLES
-specifications are required, and LABEL is optional.  Their meanings
-are as described above to MDGROUP.  PSPP warns if two variables in the
+The @subcmd{MCGROUP} subcommand creates a new multiple category set or
+replaces an existing multiple response set.  The @subcmd{NAME} and @subcmd{VARIABLES}
+specifications are required, and @subcmd{LABEL} is optional.  Their meanings
+are as described above in @subcmd{MDGROUP}.  @pspp{} warns if two variables in the
 set have different value labels for a single value, since each of the
 variables in the set should have the same possible categories.
 
-The DELETE subcommand deletes multiple response groups.  A list of
+The @subcmd{DELETE} subcommand deletes multiple response groups.  A list of
 groups may be named within a set of required square brackets, or ALL
 may be used to delete all groups.
 
-The DISPLAY subcommand displays information about defined multiple
-response sets.  Its syntax is the same as the DELETE subcommand.
+The @subcmd{DISPLAY} subcommand displays information about defined multiple
+response sets.  Its syntax is the same as the @subcmd{DELETE} subcommand.
 
 Multiple response sets are saved to and read from system files by,
 e.g., the @cmd{SAVE} and @cmd{GET} command.  Otherwise, multiple
@@ -388,7 +392,7 @@ response sets are currently used only by third party software.
 @vindex NUMERIC
 
 @display
-NUMERIC /var_list [(fmt_spec)].
+NUMERIC /@var{var_list} [(@var{fmt_spec})].
 @end display
 
 @cmd{NUMERIC} explicitly declares new numeric variables, optionally
@@ -407,7 +411,7 @@ system-missing value.
 @vindex PRINT FORMATS
 
 @display
-PRINT FORMATS var_list (fmt_spec) [var_list (fmt_spec)]@dots{}.
+PRINT FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
 @end display
 
 @cmd{PRINT FORMATS} sets the print formats for the specified
@@ -421,7 +425,7 @@ but @cmd{PRINT FORMATS} sets only print formats, not write formats.
 @vindex RENAME VARIABLES
 
 @display
-RENAME VARIABLES (old_names=new_names)@dots{} .
+RENAME VARIABLES (@var{old_names}=@var{new_names})@dots{} .
 @end display
 
 @cmd{RENAME VARIABLES} changes the names of variables in the active
@@ -443,7 +447,7 @@ to be read.
 
 @display 
 VALUE LABELS
-        /var_list value 'label' [value 'label']@dots{}
+        /@var{var_list} @var{value} '@var{label}' [@var{value} '@var{label}']@dots{}
 @end display
 
 @cmd{VALUE LABELS} allows values of numeric and short string
@@ -468,18 +472,45 @@ already present.
 @vindex STRING
 
 @display
-STRING /var_list (fmt_spec).
+STRING @var{var_list} (@var{fmt_spec}) [/@var{var_list} (@var{fmt_spec})] [@dots{}].
 @end display
 
 @cmd{STRING} creates new string variables for use in
 transformations.
 
-Specify a slash (@samp{/}), followed by the names of the string
-variables to create and the desired output format specification in
-parentheses (@pxref{Input and Output Formats}).  Variable widths are
+Specify a list of names for the variable you want to create,
+followed by the desired output format specification in
+parentheses (@pxref{Input and Output Formats}).  
+Variable widths are
 implicitly derived from the specified output formats.
+The created variables will be initialized to spaces.
+
+If you want to create several variables with  distinct
+output formats, you can either use two or more separate @cmd{STRING} commands,
+or you can specify further variable list and format specification pairs, each separated
+from the previous by a slash (@samp{/}).
+
+The following example is one way to create three string variables; Two of the
+variables have format A24 and the other A80:
+@example
+STRING firstname lastname (A24) / address (A80).
+@end example
+
+@noindent Here is another way to achieve the same result:
+@example
+STRING firstname lastname (A24).
+STRING address (A80).
+@end example
+
+@noindent @dots{} and here is yet another way:
+
+@example
+STRING firstname (A24).
+STRING lastname (A24).
+STRING address (A80).
+@end example
+
 
-Created variables are initialized to spaces.
 
 
 @node VARIABLE ATTRIBUTE
@@ -488,30 +519,30 @@ Created variables are initialized to spaces.
 
 @display
 VARIABLE ATTRIBUTE
-         VARIABLES=var_list
-         ATTRIBUTE=name('value') [name('value')]@dots{}
-         ATTRIBUTE=name@b{[}index@b{]}('value') [name@b{[}index@b{]}('value')]@dots{}
-         DELETE=name [name]@dots{}
-         DELETE=name@b{[}index@b{]} [name@b{[}index@b{]}]@dots{}
+         VARIABLES=@var{var_list}
+         ATTRIBUTE=@var{name}('@var{value}') [@var{name}('@var{value}')]@dots{}
+         ATTRIBUTE=@var{name}@b{[}@var{index}@b{]}('@var{value}') [@var{name}@b{[}@var{index}@b{]}('@var{value}')]@dots{}
+         DELETE=@var{name} [@var{name}]@dots{}
+         DELETE=@var{name}@b{[}@var{index}@b{]} [@var{name}@b{[}@var{index}@b{]}]@dots{}
 @end display
 
 @cmd{VARIABLE ATTRIBUTE} adds, modifies, or removes user-defined
 attributes associated with variables in the active dataset.  Custom
-variable attributes are not interpreted by PSPP, but they are saved as
+variable attributes are not interpreted by @pspp{}, but they are saved as
 part of system files and may be used by other software that reads
 them.
 
-The required VARIABLES subcommand must come first.  Specify the
-variables to which the following ATTRIBUTE or DELETE subcommand
+The required @subcmd{VARIABLES} subcommand must come first.  Specify the
+variables to which the following @subcmd{ATTRIBUTE} or @subcmd{DELETE} subcommand
 should apply.
 
-Use the ATTRIBUTE subcommand to add or modify custom variable
+Use the @subcmd{ATTRIBUTE} subcommand to add or modify custom variable
 attributes.  Specify the name of the attribute as an identifier
 (@pxref{Tokens}), followed by the desired value, in parentheses, as a
 quoted string.  The specified attributes are then added or modified in
-the variables specified on VARIABLES.  Attribute names that begin with
-@code{$} are reserved for PSPP's internal use, and attribute names
-that begin with @code{@@} or @code{$@@} are not displayed by most PSPP
+the variables specified on @subcmd{VARIABLES}.  Attribute names that begin with
+@code{$} are reserved for @pspp{}'s internal use, and attribute names
+that begin with @code{@@} or @code{$@@} are not displayed by most @pspp{}
 commands that display other attributes.  Other attribute names are not
 treated specially.
 
@@ -521,8 +552,8 @@ element, add an integer array index enclosed in square brackets
 indexes start at 1, not 0.  An attribute array that has a single
 element (number 1) is not distinguished from a non-array attribute.
 
-Use the DELETE subcommand to delete an attribute from the variable
-specified on VARIABLES.  Specify an attribute name by itself to delete
+Use the @subcmd{DELETE} subcommand to delete an attribute from the variable
+specified on @subcmd{VARIABLES}.  Specify an attribute name by itself to delete
 an entire attribute, including all array elements for attribute
 arrays.  Specify an attribute name followed by an array index in
 square brackets to delete a single element of an attribute array.  In
@@ -542,12 +573,12 @@ by conditional and looping structures such as @cmd{DO IF} or
 
 @display
 VARIABLE LABELS
-        var_list 'var_label
-        [ /var_list 'var_label']
+        @var{var_list} '@var{var_label}
+        [ /@var{var_list} '@var{var_label}']
         .
         .
         .
-        [ /var_list 'var_label']
+        [ /@var{var_list} '@var{var_label}']
 @end display
 
 @cmd{VARIABLE LABELS} associates explanatory names
@@ -561,72 +592,105 @@ precede the subsequent variable list with a slash (@samp{/}).
 
 
 @node VARIABLE ALIGNMENT
-@comment  node-name,  next,  previous,  u
 @section VARIABLE ALIGNMENT
 @vindex VARIABLE ALIGNMENT
 
 @display
 VARIABLE ALIGNMENT
-        var_list ( LEFT | RIGHT | CENTER )
-        [ /var_list ( LEFT | RIGHT | CENTER ) ]
+        @var{var_list} ( LEFT | RIGHT | CENTER )
+        [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
         .
         .
         .
-        [ /var_list ( LEFT | RIGHT | CENTER ) ]
+        [ /@var{var_list} ( LEFT | RIGHT | CENTER ) ]
 @end display
 
 @cmd{VARIABLE ALIGNMENT} sets the alignment of variables for display editing 
 purposes.   This only has effect for third party software.  It does not affect 
-the display of variables in the PSPP output.
+the display of variables in the @pspp{} output.
 
 
 
 
 @node VARIABLE WIDTH
-@comment  node-name,  next,  previous,  up
 @section VARIABLE WIDTH
 @vindex VARIABLE WIDTH
 @display
 VARIABLE WIDTH
-        var_list (width)
-        [ /var_list (width) ] 
+        @var{var_list} (width)
+        [ /@var{var_list} (width) ] 
         .
         .
         .
-        [ /var_list (width) ] 
+        [ /@var{var_list} (width) ] 
 @end display
 
 @cmd{VARIABLE WIDTH} sets the column width of variables for display editing
 purposes.   This only affects third party software.  It does not affect 
-the display of variables in the PSPP output.
+the display of variables in the @pspp{} output.
 
 
 @node VARIABLE LEVEL
-@comment  node-name,  next,  previous,  up
 @section VARIABLE LEVEL
 @vindex VARIABLE LEVEL
 @display
 VARIABLE LEVEL
-        var_list ( SCALE | NOMINAL | ORDINAL )
-        [ /var_list ( SCALE | NOMINAL | ORDINAL ) ]
+        @var{var_list} ( SCALE | NOMINAL | ORDINAL )
+        [ /@var{var_list} ( SCALE | NOMINAL | ORDINAL ) ]
         .
         .
         .
-        [ /var_list ( SCALE | NOMINAL | ORDINAL ) ]
+        [ /@var{var_list} ( SCALE | NOMINAL | ORDINAL ) ]
 @end display
 
 @cmd{VARIABLE LEVEL} sets the measurement level of  variables.
 Currently, this has no effect except for certain third party software.
 
 
+@node VARIABLE ROLE
+@section VARIABLE ROLE
+@vindex VARIABLE ROLE
+@display
+VARIABLE ROLE
+        /@var{role} @var{var_list}
+        [/@var{role} @var{var_list}]@dots{}
+@end display
+
+@cmd{VARIABLE ROLE} sets the intended role of a variable for use in
+dialog boxes in graphical user interfaces.  Each @var{role} specifies
+one of the following roles for the variables that follow it:
+
+@table @code
+@item INPUT
+An input variable, such as an independent variable.
+
+@item TARGET
+An output variable, such as an dependent variable.
+
+@item BOTH
+A variable used for input and output.
+
+@item NONE
+No role assigned.  (This is a variable's default role.)
+
+@item PARTITION
+Used to break the data into groups for testing.
+
+@item SPLIT
+No meaning except for certain third party software.  (This role's
+meaning is unrelated to @cmd{SPLIT FILE}.)
+@end table
+
+The PSPPIRE GUI does not yet use variable roles as intended.
+
 @node VECTOR
 @section VECTOR
 @vindex VECTOR
 
 @display
 Two possible syntaxes:
-        VECTOR vec_name=var_list.
-        VECTOR vec_name_list(count [format]).
+        VECTOR @var{vec_name}=@var{var_list}.
+        VECTOR @var{vec_name_list}(@var{count} [@var{format}]).
 @end display
 
 @cmd{VECTOR} allows a group of variables to be accessed as if they
@@ -660,10 +724,10 @@ Variables within a vector may be referenced in expressions using
 @vindex WRITE FORMATS
 
 @display
-WRITE FORMATS var_list (fmt_spec) [var_list (fmt_spec)]@dots{}.
+WRITE FORMATS @var{var_list} (@var{fmt_spec}) [@var{var_list} (@var{fmt_spec})]@dots{}.
 @end display
 
 @cmd{WRITE FORMATS} sets the write formats for the specified variables
 to the specified format specification.  Its syntax is identical to
-that of FORMATS (@pxref{FORMATS}), but @cmd{WRITE FORMATS} sets only
+that of @cmd{FORMATS} (@pxref{FORMATS}), but @cmd{WRITE FORMATS} sets only
 write formats, not print formats.