The SORTSEQ= option enables you to specify the collating
sequence for your sort. For more information, see “SORTSEQ=
System Option: UNIX, Windows, and
z/OS” in the
SAS National Language Support (NLS): Reference Guide.
CAUTION:
If you
are using a host sort utility to sort your data, then specifying the
SORTSEQ= option might corrupt the character BY variables if the sort
sequence translation table and its inverse are not one-to-one mappings.
In other words, for
the sort to work the translation table must map each character to
a unique weight, and the inverse table must map each weight to a unique
character variable.
If your translation
tables do not map one-to-one, then you can use one of the following
methods to perform your sort:
-
create a translation table that
maps one-to-one. Once you create a translation table that maps one-to-one,
you can easily create a corresponding inverse table using the TRANTAB
procedure. If your table is not mapped one-to-one, then you will receive
the following note in the SAS log when you try to create an inverse
table:
NOTE: This table cannot be mapped one to one.
For
more information, see “The TRANTAB Procedure” in the
SAS National Language Support (NLS): Reference Guide.
-
-
specify the collation order options
of your host sort utility. See the documentation for your host sort
utility for more information.
-
create a view with a dummy BY variable.
For an example, see “Creating a View with a Dummy BY Variable”
below.
Note: After using one of these
methods, you might need to perform subsequent BY processing using
either the NOTSORTED option or the NOBYSORTED system option. For more
information about the NOTSORTED option, see “BY Statement”
in the
SAS Statements: Reference. For more information about the NOBYSORTED system
option, see “BYSORTED System Option” in the
SAS System Options: Reference.