A multi-volume dataset is a single logical dataset that extends across more than one DASD volume. When the space on one volume is used up, the system automatically continues on the next volume in the list. DFSORT can use multi-volume datasets for SORTIN, SORTOUT, or sortwork (SORTWKnn). There are no special DFSORT control statements for multi-volume; you define the dataset in JCL with a volume list and sufficient space. This page explains what multi-volume means, when it is useful (especially for large sortwork or output), and what you need to specify so that the sort job has enough space across volumes.
On z/OS, a dataset is often allocated on one DASD volume. When the dataset needs more space than one volume can provide (or when you want to spread allocation across volumes), you can define it as multi-volume by specifying a list of volumes—for example, VOL=SER=(VOL001,VOL002,VOL003). The system allocates space on the first volume; when that volume is full, it continues on the next volume in the list. To the program (and to DFSORT), the dataset is still one sequential dataset: reads and writes are in order, and the program does not see where the volume boundaries are. The access method and the operating system handle the switching from one volume to the next.
Sortwork datasets (SORTWK01, SORTWK02, and so on, or dynamically allocated work datasets) must be large enough to hold the intermediate data during the sort. When the input is very large, the total sortwork required can exceed the free space on any single volume. In that case, you can define one or more sortwork datasets as multi-volume: each SORTWKnn DD can point to a dataset that has a volume list of several volumes, so the total space available for that work dataset is the sum of the free space on those volumes (up to what you allocate). That way the sort can obtain the sortwork it needs without requiring one huge volume.
When the sorted output is very large, a single volume may not have enough space for the output dataset. If you define SORTOUT as a multi-volume dataset (with a volume list and sufficient total space), the system will write to the first volume until it is full, then continue on the next. Ensure the volume list has enough total free space to hold the entire output; otherwise the job can fail with a space abend when all listed volumes are full.
Input datasets can also be multi-volume. When DFSORT reads SORTIN, it reads sequentially; the access method fetches data from the first volume, then the next, transparently. You do not need to change your DFSORT control statements. Just ensure the dataset is correctly cataloged or that the JCL points to it with the proper volume list so the system can find and read all of the data.
In JCL you specify the volume list (e.g. VOL=SER=(v1,v2,...) or VOL=(,,,n) for n volumes) and space (SPACE= or equivalent). The exact syntax depends on whether you are using SMS (Storage Management Subsystem) or non-SMS, and on your site’s conventions. The key point is that the total space available for the dataset is the sum of what can be allocated across the volumes in the list. For sortwork, that total must be enough for DFSORT to complete; for SORTOUT, it must be enough for the full output.
DFSORT does not have special logic for multi-volume. It reads and writes using standard sequential access. The multi-volume attribute is a property of the dataset and is handled by the system. So you do not need different SORT, INREC, or OPTION statements; you only need to ensure that the datasets (input, output, or work) are defined with enough space, possibly across multiple volumes.
Imagine a long row of boxes (volumes). When one box is full, we put the rest in the next box. The sorter doesn't care which box the cards are in—it just reads them in order. So we give it a list of boxes, and the system makes sure the cards are stored across the boxes. The sorter only sees one long stream of cards.
1. What is a multi-volume dataset?
2. When might you use multi-volume for sortwork?
3. Does DFSORT treat multi-volume datasets differently from single-volume for sorting logic?
4. What should you ensure when allocating a multi-volume SORTOUT dataset?
5. Who is responsible for managing space across volumes for a multi-volume dataset?