On z/OS, the "sort subsystem" is the set of programs and services that perform sorting, merging, copying, and related data operations in batch jobs. IBM supplies DFSORT (Data Facility Sort), which you invoke with program names such as SORT or ICEMAN. This page covers the basics: what the sort subsystem is, how it is invoked, and a few important rules.
On z/OS, many batch jobs need to sort or merge data. Rather than every application implementing its own sort, the operating system (or an installed product) provides a sort subsystem: a standard program that reads input from defined datasets, processes it according to control statements, and writes output. When people say "the sort subsystem" on z/OS, they usually mean the program that runs when you execute a sort step—typically DFSORT (IBM) or a licensed alternative such as Syncsort.
The sort subsystem is not a separate address space or server that stays running; it is the sort program that runs as one or more steps in your batch job. Each time your JCL runs EXEC PGM=SORT (or PGM=ICEMAN), that step invokes the sort subsystem program.
DFSORT is invoked by program name in the JCL EXEC statement. The two common names are:
EXEC PGM=SORT runs the sort program.EXEC PGM=ICEMAN does the same thing as PGM=SORT.Both names point to the same DFSORT program. Which one your shop uses is convention (and possibly what is in the load library). If your site uses a third-party sort (e.g. Syncsort), the same program names might be used to invoke that product instead, depending on library order (JOBLIB, STEPLIB). So the program name alone does not tell you which vendor's sort you are running; the messages in SYSOUT do (ICE for DFSORT, WER for Syncsort, etc.).
12345678//SORTSTEP EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=MY.INPUT,DISP=SHR //SORTOUT DD DSN=MY.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) //SYSIN DD * SORT FIELDS=(1,20,CH,A) /*
Replacing PGM=SORT with PGM=ICEMAN in the same JCL runs the same sort product; only the name in the EXEC changes.
IBM uses the three-character identifier ICE for the sort product. So:
This makes it easy to tell that the step is using IBM's sort product and to look up messages in IBM documentation (e.g. "ICE000I").
The sort "subsystem" on z/OS often includes more than one program:
PGM=ICETOOL and give it "operators" (e.g. COPY, SORT, SPLICE, COUNT, DISPLAY). It can run multiple operations in one step and is useful for reporting and multi-file tasks.So when we say "z/OS sort subsystem," we usually mean the program you run for sort/merge (SORT/ICEMAN), but the same product family includes ICETOOL and ICEGENER.
DFSORT (and typical sort products) require that SORTIN and SORTOUT point to different datasets. If they point to the same dataset, the program may overwrite input while still reading it, causing lost or incorrect data and possible abends (e.g. IEC036I). Always allocate a separate output dataset for SORTOUT. If you want to replace the input with sorted data, use a temporary or different output dataset, then in a later step (or job) copy or rename it over the original.
The sort subsystem is like a helper that only does one kind of job: putting things in order or mixing two already-ordered piles into one. You call the helper by a name (SORT or ICEMAN)—both names get the same helper. The helper has a badge that says "ICE" so you know it's the same company's helper. You must give the helper a different place to put the result than where the papers came from, or the papers could get mixed up or lost.
1. What is ICEMAN in relation to DFSORT?
2. Which message prefix indicates you are running DFSORT?
3. Can SORTIN and SORTOUT point to the same dataset in DFSORT?
4. What is ICETOOL in the z/OS sort subsystem?
5. Do PGM=SORT and PGM=ICEMAN do the same thing?