SORT-MERGE/XL is an MPE/iX subsystem that allows you to sort one or more files or merge several sorted files to form one file in a specified sequence. SORT-MERGE/XL changes the order of the records from the input file according to your specifications and writes them to the output file.
You can use SORT-MERGE/XL interactively or programmatically. Use the SORT-MERGE/XL intrinsics for programmatic use. You must specify the input and output files and the sorting (or merging) keys. The collating sequence defaults to ASCII unless you specify otherwise. For detailed information on SORT-MERGE/XL, refer to SORT-MERGE/XL Programmer's Guide (32650-90080).
Key |
|
A key is the section of the record that SORT-MERGE/XL uses to determine the order in which input records are to be rearranged for output. It is a record field you specify by stating the position of the first byte and the number of bytes in the field. The key applies to the same portion of a record for each record in a file. The data format for that portion must be of the same type in all records.
You can specify multiple keys. The first one you enter becomes the major key. SORT-MERGE/XL uses the major key to rearrange the records. If the content of two records is the same in a key field, SORT-MERGE/XL uses the content of the next specified key to determine which is written to the output file first. If the content of all the key fields for two records is identical, then SORT-MERGE/XL preserves the order found in the input file when it writes to the output file.
Ordering Sequence |
|
SORT-MERGE/XL arranges records in the output file according to an ordering sequence based on the value of data in the keys. The individual bytes in the key definitions determine these values, based on their positions in a collating sequence.
Collating Sequence |
|
The collating sequence can be ASCII, EBCDIC, a native language, or user-defined. ASCII and EBCDIC are the basic collating sequences. Native language collating sequences apply to keys of type CHARACTER. You can specify the rearrangement to be in ascending or descending order, based on the appropriate collating sequence.