BY Subcommand (ADD FILES command)
BY specifies
one or more key variables that determine the order of cases in the
resulting file. When BY is specified,
cases from the input files are interleaved according to their values
for the key variables.
-
BYmust follow theFILEsubcommands and any associatedRENAMEandINsubcommands. - The key variables specified on
BYmust be present and have the same names in all input files. - Key variables can be string or numeric.
- All input files must be sorted in ascending order
of the key variables. If necessary, use
SORT CASESbeforeADD FILES. - Cases in the resulting file are ordered by the values of the key variables. All cases from the first file with the first value for the key variable are first, followed by all cases from the second file with the same value, followed by all cases from the third file with the same value, and so forth. These cases are followed by all cases from the first file with the next value for the key variable, and so on.
- Cases with system-missing values are first in the resulting file. User-missing values are interleaved with other values.