DFSORT
The standard sort utility, used far beyond sorting to select, merge, reformat and summarise records at speed.
Also written SORT, SYNCSORT, sort utility
DFSORT is IBM's sort product, and its equivalents from other vendors work much the same way. Its name undersells it: sorting is the least of what it does in practice.
The obvious use is ordering records by one or more fields. Beyond that, it selects records matching conditions, drops the rest, merges already-sorted files, removes duplicates, rearranges fields into a different layout, adds constants, and produces totals and counts.
This matters because a sort step is often faster and simpler than writing a program to do the same thing. A great deal of production batch consists of sort steps doing work that looks like it should need code.
Control statements go in on a DD statement, and the input and output datasets use conventional names: SORTIN for input, SORTOUT for output. Statements such as SORT, INCLUDE, OMIT and OUTREC cover most requirements.
Learning a little of it early is one of the highest-value things a batch newcomer can do, because it comes up constantly.
Related terms
- Utility programA supplied program that performs a standard job such as copying, sorting, comparing or managing datasets, driven by control statements.
- Sequential datasetThe simplest kind of dataset: records stored one after another and normally read from start to finish.
- JCLJob Control Language: the language used to tell the mainframe what programs to run, in what order, and with what files.
- Batch processingRunning work in bulk, without anyone watching, usually on a schedule. The overnight run that settles a day of transactions.