HH&S product

XSMeXtended Sort Merge

Understanding the difference between sort and merge operations.

XSM Sort / Merge discussion

This article explains the difference between sorting and merging operations.

SORT / MERGE = MERGING with implicit SORT

Sorting several files with an implicit merge

Sorting records from one or more input files produces one set of records ordered according to the specified sort keys.

When several input files are specified in a sort operation, their records are merged automatically during the sort. Therefore, you do not need to specify a MERGE operation: it is implicit.

The operating system sets its own limits on the number of files that can be sorted or merged in one operation, and the system administrator may also define user quotas.

XSM can process 1,024 files simultaneously.
If this is not sufficient, contact us and we can increase this value.

See the MERGE operation below.

MERGE ONLY = MERGING presorted files

Merging presorted files

Merging records from several input files produces one set of records ordered according to the specified sort keys. The input files must already be sorted; otherwise, the operation fails.

The MERGE operation should therefore be used only when the input files are already sorted on the required keys.

A MERGE operation is faster than a SORT + MERGE operation.

However, one SORT operation—with its implicit merge—is faster than a SORT operation followed by a separate MERGE operation.