How Space Allocation Works: Tracks, Cylinders, Extents and Volumes
How z/OS turns a SPACE parameter into tracks, cylinders and extents on a 3390 volume, and why a data set can fail with a space abend despite free volumes.

A job that writes a sequential file and dies with an SB37 or D37 abend is almost always a space allocation problem, and the cure depends on knowing what the system actually allocated. This post explains the units behind the SPACE parameter on z/OS 3.1: tracks, cylinders, extents and volumes. It follows the sequence a data set goes through, from the numbers you code to the extents the system records, and it shows the arithmetic so you can size a file before you run the job. It is the first step in the datasets part of the mainframe ladder, so it comes before VSAM and PDS tuning, which both build on these units.
The disk geometry behind the numbers
z/OS addresses direct access storage in the geometry of the 3390 device, even though the physical hardware is a modern storage subsystem emulating it. A track on a 3390 holds up to 56,664 bytes. A cylinder is 15 tracks, so one cylinder holds up to 849,960 bytes. A volume is a count of cylinders: a 3390 Model 3 has 3,339, a Model 9 has 10,017, a Model 27 has 32,760 and a Model 54 has 65,520. Larger volumes, called extended address volumes (EAV), go beyond 65,520 cylinders, and the space past that boundary is called the extended addressing space.
The track and the cylinder are the two units you will use in JCL. Everything else is a count of them.
Coding the SPACE parameter
The SPACE parameter on a DD statement names a unit, a primary quantity, an optional secondary quantity and optional extras:
//NEWDS DD DSN=PROD.PAYROLL.MASTER,DISP=(NEW,CATLG,DELETE),
// RECFM=FB,LRECL=80,BLKSIZE=27920,
// SPACE=(CYL,(5,1),RLSE)CYL means the quantities are cylinders. You can also code TRK, or a block length such as SPACE=(27920,(100,10)), which asks for room for 100 blocks and then 10 more. With a block length the system rounds the request up to whole tracks, or cylinders if you add ROUND.
The primary quantity is allocated when the data set is created. The secondary quantity is requested each time the data set fills its current extent and the program keeps writing. RLSE releases unused space when the data set is closed after being written, so a file you sized generously gives the excess back. A third value in the parentheses, as in (CYL,(5,1,10)), is the number of 256-byte directory blocks, and it only applies to a partitioned data set.
From primary and secondary to extents
An extent is a contiguous range of tracks on one volume. The primary allocation tries to get one extent of the requested size. If the volume has no single run of free tracks that large, the system may satisfy the request with several extents, up to five for the primary when it is not asked for CONTIG, which demands one extent and fails otherwise.
Each time the data set fills, the system adds a secondary extent of the secondary quantity. A sequential data set can have at most 16 extents on one volume. With the primary, that allows 15 secondary extents. When all 16 are used and the program writes another record, the job abends with B37 or D37, depending on the reason.
For a data set with SPACE=(CYL,(5,1)) that fills completely, the capacity before an abend on one volume is the primary of 5 cylinders plus 15 secondaries of 1 cylinder, which is 20 cylinders. That number is useful to remember: an undersized secondary is the usual reason a file that should fit still fails.
Worked arithmetic for a sizing
Take an 80-byte record file with BLKSIZE=27920. That is 349 records per block. On a 3390, two blocks of 27,920 bytes fit on a track (the half-track block size, the largest that lets two blocks share one track, is 27,998). So one track holds 698 records.
For 1,000,000 records you need 1,000,000 divided by 698, which is 1,432.7, so 1,433 tracks. Dividing by 15 tracks per cylinder gives 95.5, so 96 cylinders. A reasonable request is SPACE=(CYL,(100,20),RLSE): a primary with a small margin and a secondary that is a fraction of the primary. The RLSE then returns the unused part when the job finishes.
Specifying BLKSIZE=0 and letting the system pick, which is the normal practice on z/OS, produces the same half-track value on 3390 for most record lengths, so the arithmetic above holds.
Volumes: when one is not enough
A non-SMS sequential data set can span up to 59 volumes, requested with the volume count in the VOL parameter, such as VOL=(,,,3). The extent limit of 16 applies to each volume, so a multivolume data set can grow past one volume's capacity.
In an SMS-managed environment, the storage group chooses the volume. The data class may also provide a space default, so the SPACE parameter can be omitted, and a space constraint relief attribute can let the system spread the allocation across more extents or reduce the quantity. A data set can also be allocated with DSNTYPE=EXTREQ or EXTPREF, which ask for extended format, and an extended-format sequential data set is not subject to the 16-extent limit in the same way.
A job that allocates a file and its messages
An empty allocation with IEFBR14 is the cheapest way to see what the system did:
//ALLOC JOB (ACCT),'ALLOCATE',CLASS=A,MSGCLASS=X
//STEP1 EXEC PGM=IEFBR14
//NEWDS DD DSN=PROD.PAYROLL.MASTER,DISP=(NEW,CATLG,DELETE),
// RECFM=FB,LRECL=80,BLKSIZE=27920,
// SPACE=(CYL,(5,1),RLSE)IEF142I ALLOC STEP1 - STEP WAS EXECUTED - COND CODE 0000
IEF285I PROD.PAYROLL.MASTER CATALOGED
IEF285I VOL SER NOS= VOL001.The volume serial will differ on your system. To see the extents afterwards, list the data set in ISPF option 3.2 or with LISTCAT ENTRIES(PROD.PAYROLL.MASTER) ALL, which reports the allocated space and the extent map.
What an SB37 or D37 really tells you
The three most common space abends differ in what ran out:
| Abend | What ran out |
|---|---|
| B37 | The volume has no more space, or the 16-extent limit was reached on it |
| D37 | The primary quantity was full and no secondary quantity was coded |
| E37 | The data set tried to extend to another volume and none was available |
The fix for D37 is to code a secondary quantity. The fix for B37 is either a larger secondary, so fewer extents are needed, or a multivolume request.
Official coverage of these parameters is in the z/OS documentation, under MVS JCL Reference for SPACE and DFSMS for extents.


