Parallel processing in DFSORT means the product uses more than one thread or engine to perform sort or merge work at the same time. On a system with multiple CPUs or logical processors, this can reduce elapsed time by spreading work across them. Not every DFSORT environment supports parallelism; when it does, it is often controlled by an option such as THREADS in the OPTION statement. This page explains what parallel processing is, when it helps, what limits its benefit, and how it relates to memory, sortwork, and other tuning parameters.
In a single-threaded sort, one logical stream of work runs: input is read, records are sorted (in memory and/or sortwork), and output is written. In parallel processing, DFSORT can use multiple threads or engines so that several streams of work run concurrently. For example, different portions of the sort or merge can be handled by different threads, each potentially using a different CPU. The goal is to shorten elapsed time by using more of the system’s processing capacity. The exact implementation (how work is split, how many threads, and how they coordinate) depends on your DFSORT or z/OS Beyond Sort version and installation.
Parallel processing tends to help when:
So parallelism is one lever among many: you still need sufficient memory (SIZE/MOSIZE), sortwork (DYNALLOC or SORTWK), and a realistic FILSZ. Enabling THREADS (or the equivalent) can then reduce elapsed time when the workload and system are suitable.
| Factor | Effect |
|---|---|
| Workload size | Larger sorts can benefit more; small sorts may have overhead that outweighs gains. |
| CPU availability | Multiple processors must be available for threads to run in parallel. |
| Memory | Each thread may use memory; insufficient memory can limit parallelism or cause paging. |
| I/O | If the job is I/O-bound, more threads may not reduce elapsed time. |
| Product/version | Support and option names (e.g. THREADS) vary by DFSORT/Beyond Sort release. |
When your DFSORT or z/OS Beyond Sort installation supports parallel processing, it is typically controlled by an option in the OPTION statement or by a PARM (or DFSPARM) value on the EXEC. A common option name is THREADS; the syntax might be THREADS=n to specify the number of threads, or a keyword like THREADS=YES. The exact option name, allowed values, and default behavior are product- and installation-dependent. For details on the THREADS option and syntax, see the THREADS and parallelism tutorial. Here we focus on the concepts: what parallelism is and when to consider it.
The following is illustrative; your product may use a different keyword or syntax.
12OPTION THREADS=4 SORT FIELDS=(1,20,CH,A)
This might request that DFSORT use up to four threads for sort work. Whether four is optimal depends on your system (number of CPUs, memory, and the size of the sort). Some installations leave the default (e.g. OPTIMAL or a product-chosen value) and only override when tuning for a specific workload.
Parallel processing does not replace the need for adequate memory and sortwork. The product still needs enough central storage (SIZE/MOSIZE) and enough sortwork (DYNALLOC or SORTWK) to complete the sort. Parallelism spreads the work across threads; each thread may use memory and may generate I/O to sortwork. So tuning typically involves setting FILSZ, SIZE, and sortwork appropriately, and then enabling or tuning THREADS (or equivalent) if supported. If the job fails with capacity or resource errors, address memory and sortwork first; parallelism is an optimization on top of that.
If your sort is I/O-bound—meaning the CPUs are often idle waiting for data from disk—adding more threads may not reduce elapsed time much, because the bottleneck is the disk, not the CPU. In that case, improving I/O (e.g. more or faster sortwork volumes, better BLKSIZE, or more memory to reduce sortwork I/O) may help more than increasing THREADS. If the job is CPU-bound and has enough memory and sortwork, then parallelism can help. Understanding your job’s profile (e.g. from SMF or performance tools) helps decide where to tune.
Not all DFSORT environments support parallel processing. Support and option names (e.g. THREADS, PARALLEL) vary by product (e.g. DFSORT vs z/OS Beyond Sort) and release. Some installations may have the feature disabled or may use different PARM conventions. Always check your DFSORT Application Programming Guide or installation documentation to see whether parallelism is available and how to enable or tune it.
Imagine sorting a huge pile of cards. If one person does it, it takes a long time. If four friends help and each sorts a part of the pile, then you combine the parts, the job can finish sooner—but only if you have four friends (CPUs) and enough table space (memory) for everyone to work. If the slow part is running to get more cards (I/O), then having more friends doesn’t help until the running is faster. Parallel processing is like having more friends help with the sort; it works when the job is big enough and when you have enough helpers and space.
1. What is parallel processing in DFSORT?
2. When does parallel processing help most?
3. What can limit the benefit of parallel sort?
4. How is parallel processing typically enabled in DFSORT?
5. Is parallel processing available in all DFSORT environments?