MainframeMaster

Multi-Volume Datasets

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.

Other DFSORT Topics
Progress0 of 0 lessons

What Multi-Volume Means

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.

Using Multi-Volume for Sortwork

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.

Using Multi-Volume for SORTOUT

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.

Using Multi-Volume for SORTIN

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.

JCL and Space

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.

No Special DFSORT Logic

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.

Explain It Like I'm Five

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.

Exercises

  1. What is a multi-volume dataset and who handles switching from one volume to the next?
  2. When would you define sortwork as multi-volume?
  3. Does DFSORT require different control statements when SORTOUT is multi-volume?
  4. What can happen if the volume list for SORTOUT does not have enough total space?

Quiz

Test Your Knowledge

1. What is a multi-volume dataset?

  • A dataset with multiple record types
  • A single logical dataset that extends across more than one DASD volume; when one volume is full, the system uses the next volume in the list
  • Multiple datasets with the same name
  • A tape dataset only

2. When might you use multi-volume for sortwork?

  • Never
  • When a single volume does not have enough free space for the sortwork needed; spreading sortwork across volumes allows the sort to get the required total space
  • Only for SORTOUT
  • Only with OPTION COPY

3. Does DFSORT treat multi-volume datasets differently from single-volume for sorting logic?

  • Yes, sort keys change
  • No; to DFSORT the dataset is a single sequential stream. The system handles reading and writing across volumes; the sort logic is the same
  • Only for MERGE
  • Only for INREC

4. What should you ensure when allocating a multi-volume SORTOUT dataset?

  • Only record length
  • Enough total space across the volume list for the output, and that the volume list is correct (VOL=SER= or equivalent) so the system can extend to the next volume when one fills
  • Only blocksize
  • Only one volume

5. Who is responsible for managing space across volumes for a multi-volume dataset?

  • DFSORT only
  • The access method and the operating system (z/OS); they handle extending the dataset to the next volume when the current one is full. DFSORT just reads/writes the dataset
  • The programmer in the exit
  • JCL only