+@c PSPP - a program for statistical analysis.
+@c Copyright (C) 2017 Free Software Foundation, Inc.
+@c Permission is granted to copy, distribute and/or modify this document
+@c under the terms of the GNU Free Documentation License, Version 1.3
+@c or any later version published by the Free Software Foundation;
+@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+@c A copy of the license is included in the section entitled "GNU
+@c Free Documentation License".
+@c
@node Data Manipulation
@chapter Data transformations
@cindex transformations
number of source and target variables. The target variables must not
already exist.
-By default, increasing values of a source variable (for a string, this
-is based on character code comparisons) are recoded to increasing values
-of its target variable. To cause increasing values of a source variable
-to be recoded to decreasing values of its target variable (@var{n} down
-to 1), specify @subcmd{DESCENDING}.
+@cmd{AUTORECODE} ordinarily assigns each increasing non-missing value
+of a source variable (for a string, this is based on character code
+comparisons) to consecutive values of its target variable. For
+example, the smallest non-missing value of the source variable is
+recoded to value 1, the next smallest to 2, and so on. If the source
+variable has user-missing values, they are recoded to
+consecutive values just above the non-missing values. For example, if
+a source variables has seven distinct non-missing values, then the
+smallest missing value would be recoded to 8, the next smallest to 9,
+and so on.
+
+Use @subcmd{DESCENDING} to reverse the sort order for non-missing
+values, so that the largest non-missing value is recoded to 1, the
+second-largest to 2, and so on. Even with @subcmd{DESCENDING},
+user-missing values are still recoded in ascending order just above
+the non-missing values.
+
+The system-missing value is always recoded into the system-missing
+variable in target variables.
+
+If a source value has a value label, then that value label is retained
+for the new value in the target variable. Otherwise, the source value
+itself becomes each new value's label.
+
+Variable labels are copied from the source to target variables.
@subcmd{PRINT} is currently ignored.
The @subcmd{GROUP} subcommand is relevant only if more than one variable is to be
recoded. It causes a single mapping between source and target values to
-be used, instead of one map per variable.
+be used, instead of one map per variable. With @subcmd{GROUP},
+user-missing values are taken from the first source variable that has
+any user-missing values.
If @subcmd{/BLANK=MISSING} is given, then string variables which contain only
whitespace are recoded as SYSMIS. If @subcmd{/BLANK=VALID} is given then they
@vindex COUNT
@display
-COUNT @var{var_name} = @var{var}@dots{} (@var{value}@dots{}).
+COUNT @var{var_name} = @var{var}@dots{} (@var{value}@dots{})
+ [/@var{var_name} = @var{var}@dots{} (@var{value}@dots{})]@dots{}
Each @var{value} takes one of the following forms:
@var{number}
appears or not.
If @samp{INTO @var{dest_vars}} does not appear, then values will be recoded
-``in place´´. This means that the recoded values are written back to the
+``in place''.
+This means that the recoded values are written back to the
source variables from whence the original values came.
In this case, the @var{dest_value} for every mapping must imply a value which
has the same type as the @var{src_value}.
For example, if the source value is a string value, it is not permissible for
@var{dest_value} to be @samp{SYSMIS} or another forms which implies a numeric
result.
+It is also not permissible for @var{dest_value} to be longer than the width
+of the source variable.
+
The following example two numeric variables @var{x} and @var{y} are recoded
in place.
Zero is recoded to 99, the values 1 to 10 inclusive are unchanged,
@end example
@noindent Here we have two recodings. The first affects the source variable
@var{a} and recodes in-place the value 2 into 22 and all other values to 99.
-The second recoding copies the values of @var{b} into the the variable @var{z},
+The second recoding copies the values of @var{b} into the variable @var{z},
changing any instances of 1 into 3.
@node SORT CASES