SORT-MERGE/XL General User's Guide (32650-90883)
14 Chapter1
Introduction To SORT-MERGE/XL
How Can You Sort?
How Can You Sort?
You can use SORT-MERGE/XL to sort or merge data in various ways. Some sequences you
might choose as the basis for sorting or merging data could be:
• Alphabetically in either an ascending or descending order.
• Numerically in either an ascending or descending order.
• Alphabetically or numerically based on a single key data item.
• Alphabetically or numerically based on more than one key data item.
• Define a unique collating sequence for your application.
• Merge two or more sorted files into a new merged file.
The SORT/XL Process
The procedure for using the SORT/XL subsystem is explained below. By invoking just a
few commands you can convert the types of data mentioned above, from random listings,
into productive and useful data.
The following example shows accessing SORT/XL, identifying the file to be sorted,
identifying the file where the sorted data is to be stored, identifying the item(s) within the
file to be sorted, and initiating the sort operation.
:SORT
>INPUT
filename
>OUTPUT
filename
>KEY 1,10
>END
Taking this example line by line:
:SORT
Specifying SORT at the MPE XL colon prompt (:) takes you into the SORT/XL subsystem
and displays the subsystem chevron prompt (>). The ability to run a program, such as
SORT.PUB.SYS, without explicitly using the MPE XL :RUN command is called an Implied
:RUN. You can use the :RUN command (:RUN SORT.PUB.SYS) or simply enter :SORT to
access the subsystem.
>INPUT
filename
Specifies invoking the SORT/XL >INPUT command and identifies the file you want sorted.
>OUTPUT
filename
Specifies invoking the SORT/XL >OUTPUT command and identifies the name of the file
where the sorted data is to be stored. The file identified can be either a new or an existing
file.