SORT-MERGE/XL General User's Guide (32650-90883)
Chapter 2 23
Getting Started With SORT-MERGE/XL
Collating Sequences
If you merge the two files (SORTED1 and SORTED2) based on the command >KEY 1, 9; 10,
14, the resulting new file (MERGED1) would contain the information shown in Figure 2-6.
Figure 2-6. Merged File MERGED1
For additional information on merging files, refer to Chapter 4.
Collating Sequences
The collating sequence defines the order in which characters are listed and records are
sorted and merged. SORT-MERGE/XL allows you to specify the collating sequence as
either ASCII, EBCDIC, a native language sequence, or a user-defined sequence. You can
specify these sequences to be ordered in either an ascending or descending order.
The >DATA command allows you to specify either an ASCII or EBCDIC collating sequence.
The >LANGUAGE command allows you to specify the collating sequence for various
non-English languages if they are configured on your system. The >ALTSEQ command
allows you to alter the ASCII character sequence to create a customized sequence to suit
your application.
A common reason for altering the standard ASCII sequence is to have each upper case
letter followed by its corresponding lower case letter, rather than listing all upper case
letters first, followed by all lower case letters.
You may also want to use this feature to alter the sequence of special characters. For
example, an accountant might wish to have $ appear directly after D (so that $ INVENTORY
would appear immediately after Dollar INVENTORY, rather than with the special
characters.) Refer to "Defining Your Own Collating Sequence" in Chapter 3 for an example
on altering the sequence so that $ follows D but comes before E.
The standard types of collating sequences available to you, as well as information on
user-defined collating sequences, are discussed below.
1 2 3 4
1234567890123456789012345678901234567890123456789
JONES AL POLITICIAN 768098989
JONES SMOKEY TRUCKER 333887777
SMITH REGGIE OUTFIELDER 436897302
SOUSE EGBERT DETECTIVE 123234454
TRUMAN HARRY POLITICIAN 895634409
WELBY MARCUS PHYSICIAN 242244444