This article explains the difference between sorting and merging operations with XSM.
SORT with multiple input files: implicit merge during sorting
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.
MERGE: merge already sorted input files without re-sorting
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.
When the input files are already sorted, a MERGE operation avoids sorting them again and is therefore faster than an unnecessary SORT operation.
A single SORT operation—with its implicit merge—is faster than performing a SORT followed by a separate MERGE operation.
