SORT-MERGE/XL

SORT-MERGE/XL is an MPE/iX subsystem that allo ws you to sort one or more ￿les or merge several sorted ￿les to form one ￿le in a speci￿ed sequence. SOR T-MERGE/XL changes the order of the records from the input ￿le according to y our speci￿cations and writes them to the output ￿le.

You can use SORT-MERGE/XL interactively or programmatically . Use the SORT-MERGE/XLintrinsics for programmatic use. Y ou must specify the input and output ￿les and the sorting (or merging) k eys. The collating sequence defaults to ASCII unless y ou specify otherwise. F or detailed information on SOR T-MERGE/XL, refer to SORT-MERGE/XL Programmer's Guide (32650-90080).

Key

A key is the section of the record that SOR T-MERGE/XL uses to determine the order in which input records are to be rearranged for output. It is a record ￿eld y ou specify by stating the position of the ￿rst b yte and the number of bytes in the ￿eld. The k ey applies to the same portion of a record for eac h record in a ￿le. The data format for that portion m ust be of the same type in all records.

You can specify m ultiple keys. The ￿rst one y ou enter becomes the major k ey. SORT- MERGE/XL uses the major k ey to rearrange the records. If the con tent of two records is the same in a k ey ￿eld, SORT-MERGE/XL uses the con tent of the next speci￿ed k ey to determine which is written to the output ￿le ￿rst. If the con tent of all the key ￿elds for two records is iden tical, then SORT-MERGE/XL preserves the order found in the input ￿le when it writes to the output ￿le.

Ordering Sequence

SORT-MERGE/XL arranges records in the output ￿le according to an ordering sequence based on the value of data in the keys. The individual b ytes in the key de￿nitions determine these values, based on their positions in a collating sequence.

Collating Sequence

The collating sequence can be ASCII, EBCDIC, a nativ e language, or user-de￿ned. ASCII and EBCDIC are the basic collating sequences. Native language collating sequences apply to k eys of type CHARACTER . You can specify the rearrangemen t to be in ascending or descending order, based on the appropriate collating sequence.

Utilities and Tools 2-9