JCL

Space ABEND – SB37, SD37, SE37 Resolution

Space ABEND is among the most common JCL failures developers encounter in production and batch processing. These abends indicate an out‑of‑space condition on DASD volumes and are typically raised when a dataset cannot be extended or allocated with the requested amount of space. There are three types of Space ABEND as mentioned below.

  • SB37: There are not enough space or no more extents available on the current volume. The system gave all the primary space and as much secondary space as it could. Disk volume out of space, cannot write output.
  • SD37: Primary disk space was exceeded and either no secondary space allocation was specified, or it was insufficient.
  • SE37: When there are no more volumes available.
Abend code Primary cause Typical fix
SB37 End‑of‑volume, no more space or no further volumes specified. Increase SPACE; allow multi‑volume or move dataset to larger volume.
SD37 Primary exceeded, no or insufficient secondary allocation. Add/raise secondary space in SPACE parameter; adjust UNIT/SMS if needed.
SE37 Max extents reached or no candidate volumes available. Increase primary/secondary sizes; reduce extent count; ensure more volumes.

Understanding JCL SPACE allocation (CYL/TRK)

Before looking at each abend in detail, it is important to understand how the SPACE parameter works. The SPACE parameter specifies the primary and secondary allocation. 

SPACE=(CYL,(100,100))
  • Primary = 100 cylinders
  • Secondary = 100 cylinders

When the dataset is created, the system attempts to allocate the primary extent (100 cylinders). As the dataset grows and becomes full, the system extends it by allocating secondary extents, one at a time, until space is exhausted or extent limits are reached.

For non‑VSAM datasets, the system allows up to 16 extents per volume, typically one primary + up to 15 secondary extents. With the above allocation:

Maximum size on one volume = 100 (primary) + 15 × 100 (secondary) = 1600 cylinders.

If the dataset growth exceeds this, or if the volume itself is full, you will encounter one of the Space ABENDs.

SB37 ABEND – Not enough space on current volume

What is SB37?

An SB37 abend occurs when the dataset reaches an end‑of‑volume condition and the system cannot allocate more extents or space on the current volume. This may happen because:

  • There is not enough free space left on the DASD volume.
  • The dataset has already consumed the allowed extents on that volume.
  • No additional volume has been specified or available to continue allocation.

In practice, the system has given the dataset all primary space and as much secondary space as it could on the current volume, but it still ran out of capacity.

Typical scenarios

  • Large sort work datasets growing beyond planned size.
  • Report/output files larger than usual month‑end or year‑end volumes.
  • Jobs constrained to a specific volume that is almost full.

How to resolve SB37

Common corrective actions include:

  • Increase the SPACE allocation – raise primary and/or secondary space in the JCL based on realistic peak usage.
  • Allow multi‑volume datasets – remove strict volume constraints so the dataset can extend to another suitable volume, if site standards allow.
  • Move the dataset to a volume with more space – for existing datasets, utilities or storage management tools can be used to move data.

If the underlying volume is nearly full for many jobs, the storage team may need to free space or add capacity.

SD37 ABEND – Primary exceeded, no effective secondary

What is SD37?

An SD37 abend indicates that the dataset’s primary space has been exhausted and either:

  • No secondary space was specified, or
  • The secondary allocation was too small or could not be used.

Essentially, the system has no instructions or usable space to extend the dataset when it outgrows the primary extent.

Typical scenarios

  • SPACE parameter specified with only a primary quantity (no secondary), so the dataset cannot extend.
  • Secondary space given as a trivial value, causing rapid failure when datasets grow.
  • Temporary datasets or certain allocations where multi‑volume or secondary allocation is restricted.

How to resolve SD37

To fix and prevent SD37 errors:

  • Specify a reasonable secondary allocation in SPACE, e.g.: SPACE=(CYL,(primary,secondary),RLSE)
  • Ensure the secondary quantity is large enough to handle typical growth.
  • Coordinate with storage management if policies restrict secondary or multi‑volume allocations.

By providing adequate secondary space, the dataset can extend when primary space is consumed, often converting potential SD37 situations into manageable multi‑extent allocations.

SE37 ABEND – No more extents or volumes available

What is SE37?

An SE37 abend usually means that:

  • The dataset has reached the maximum number of extents, or
  • There are no additional volumes available in the storage group to extend the dataset across.

For non‑VSAM datasets, hitting the 16‑extent limit per volume is a common cause, especially if secondary allocations are small and many incremental extents have already been taken.

Typical scenarios

  • Datasets repeatedly extended with small secondary allocations (many tiny extents).
  • Storage pool has no additional free volumes that satisfy allocation requirements.
  • SMS‑managed datasets exhausting candidate volumes in the storage group.

How to resolve SE37

To address SE37:

  • Increase primary and secondary allocation sizes so the dataset grows in fewer but larger extents.
  • Avoid specifying too many small secondary allocations; this reduces the risk of hitting extent limits quickly.
  • Work with storage management to ensure additional candidate volumes are defined, if required.

In some environments, you may need to reallocate the dataset on a different storage class or volume group with more room.

One effective way to avoid repeated Space ABENDs is to base your SPACE parameter on peak data volume and use a balanced primary/secondary ratio.

Step 1: Estimate peak volume
  • Review previous job runs that caused SB37/SD37/SE37.
  • Analyze input and output record lengths and counts; approximate the peak size in cylinders or tracks.
  • Suppose your estimated peak volume is 100 cylinders.
Step 2: Use proportional primary and secondary

A commonly recommended pattern:

  • Primary space ≈ 50% of peak volume
  • Secondary space ≈ 10% of peak volume per extent

For a 100‑cylinder peak:

SPACE=(CYL,(50,10),RLSE)

Here:

  • Primary = 50 cylinders (half of peak)
  • Secondary = 10 cylinders each

Assuming up to 15 secondary extents, the dataset can grow to:

  • Total = 50 (primary) + 15 × 10 (secondary) = 200 cylinders
  • That is 200% of the peak volume, giving room for growth while limiting up‑front allocation.

The RLSE subparameter instructs the system to release unused space when the dataset is closed, improving DASD utilization.

This pattern works especially well for sort work files and large temporary datasets.

Additional techniques to prevent Space ABENDs

Beyond tuning SPACE, several operational and design practices help reduce SB37, SD37, and SE37 occurrences.

Use TAPE datasets for very large files

For extremely large, sequential datasets that are written once and read sequentially (like archives, logs, or backups), TAPE can be preferable to DASD, depending on site policies. Moving such workloads off DASD reduces pressure on disk volumes and minimizes Space ABEND risk for other jobs.

Use GDGs (Generation Data Groups)

For datasets that grow over time and are kept as historical series, GDGs help by:

  • Splitting data across generations instead of growing one massive file.
  • Limiting each generation to a reasonable size, making allocation more predictable.

This is especially helpful for scheduled batch jobs that append data daily or monthly.

Monitor DASD utilization and extent usage

Storage and operations teams should:

  • Regularly monitor volume utilization and dataset extent counts.
  • Proactively rebalance heavily used volumes and storage groups.

For problem datasets, utilities and automation (including REXX‑based tools) can analyze and adjust primary/secondary quantities based on actual usage.

Review SMS and UNIT parameters

Incorrect or overly restrictive UNIT or SMS storage class settings can force allocations onto unsuitable or full volumes.

  • Ensure UNIT and storage class point to appropriate device groups.
  • Allow multi‑volume datasets where justified and permitted by standards.

Steps to Fix Space Abend

Give primary and secondary allocations: While allocating your dataset give primary and secondary allocations in space specification provided that there are enough DASD units for secondary space allocation, it is important also to maintain some sort of a reasonable balance between primary and secondary space requests.  While there are no universal rules for determining what balance is “right”, there is a “rule of a thumb” that works reasonably well in most cases.

  • Evaluate the “peak” volume of the output data set (CYLs or TRKs).  One good way is to look at input file processing of which caused B37 abend and make approximate adjustments based on the ratio of output/input record lengths.  Let it be 100 CYLs, for example.
  • Use 50% of the “peak” volume as primary space and 10% of the peak volume as secondary space.  This will give the following space allocation for  100 CYL “peak” volume example:  SPACE=(CYL,(50,10),RLSE). Release unused space when the output data set gets closed is a good practice improving the overall performance.
  • As can be easily seen, this allocation balance, while requesting only 50% of “peak” volume upfront in primary space request, permits to increase data set  size up to 200% of the “peak” volume (50%+15*10%=50%+150%=200%).  Provided, of course, that the sufficient number of DASD units was defined.  For most practical situations (a typical one is space request for sort work files) this will be a reasonable balance between primary and secondary space.

Allocate the same dataset with a different name: It is always nice to create another dataset with the same DCB parameters. Give space parameters so that you can your dataset can fit in. You can just go to your JCL and change DD name to a new one. If you want to allocate with the same name then delete the existing one and reallocate.

Use data class Compress: You can prevent the dataset to exceed space by using the data class COMPRESS. This data class can be used for only DASD files, It won’t work with the TAPE files in the systems. It is very simple to use just add the statement DATACLAS=COMPRESS in your dataset parameter list separately.

Use Dataset name type Large: In order to accommodate huge volume datasets in Large format, PS files were introduced in z/OS 1.7 . They can allocate space beyond 65535 tracks per volume. A large dataset type is available for PS datasets. Generally, they are used for storing large format datasets.

Command to compress the PDS: In case if you are editing a member is PDS and you are not able to save it due to space issues then you can just open a new ISPF window. Go to option 3.4 browse. Put the PDS name and hit enter. Once the PDS name gets listed then put a command ‘Z’ against it. The dataset will be compressed.

TMSFORMT Expand utility: This utility can be used in order to move the dataset to a new volume and allocate new space parameters for the same.

TAPE datasets instead of DASD: This is one of the preventive techniques you can use for allocating the large dataset. You can use the TAPEs for storing the datasets instead of DASD. If you don’t need tape then use GDGs for storing large datasets.

Steps to Fix Space Abend in PDS

If you are in an edit session, you are not able to leave the session until you deal with the problem. Some of the things you can do are:

  • Compress the data set, if it is a PDS, by doing the following:
    • Split (PF 2) the screen and select the UTILITIES option (option 3).
    • Select the LIBRARIES option (option 1) on the Utility Selection Menu.
    • Specify the name of the data set and enter C on the OPTION line.
    • When the data set is compressed, you see the message: COMPRESS SUCCESSFUL
    • You should then be able to swap (PF 9) to the edit session and save the new material.
  • Allocate a larger data set and copy into it by doing the following:
    • Split (PF 2) the screen and select UTILITIES (option 3), then DATASET (option 2) from the other side of the split.
    • Specify the name of the data set that received the abend to display its characteristics.
    • Allocate another data set with more space.
    • Select the MOVE/COPY (option 3) on the Utility Menu to copy members from old to new larger data set.
    • Browse (option 1) new data set to make sure everything was copied correctly.
    • Swap (PF 9) back to the abending edit session, type cc on the top line of input, cc on the bottom line of input, create on the COMMAND line, and press the Enter key.
    • Enter the new, larger data set name and a member name to receive the copied information.
    • You again see the abending edit session. Enter cancel on the COMMAND line. Press the RETURN PF key (PF 4) key to exit the edit session.
    • Select the DATASET option (option 2) from the Utility Selection Menu to delete the old data set.
    • Rename the new data set to the old name.
  • Cancel the new material entered in the edit session by entering cancel on the COMMAND line. You should then be able to exit without abending, however, all information that was not previously saved is lost.

Note: Some installations use Space Manager to increase space for a data set. By issuing a command, they can automatically increase the data set’s space & avoid Space Abend.

 

Conclusion

SB37, SD37, and SE37 are all Space ABENDs that indicate your dataset has run out of room—but they point to slightly different underlying allocation issues. By understanding how JCL’s SPACE parameter, primary/secondary extents, and volume allocation work, you can:

  • Diagnose the exact cause more quickly using the specific Sx37 code and reason codes.

  • Apply the right fix—whether it is adding secondary space, allowing multi‑volume growth, increasing primary allocation, or moving to a different volume.

  • Design better SPACE strategies and preventive practices (GDGs, tapes, monitoring) to keep critical batch jobs running smoothly.

 

Read JCL blogs : Click Here SYNCSORT Manual : Click Here

 

Admin

Share
Published by
Admin

Recent Posts

AI Product Owner : Use Cases with Examples and Tools

The Product Owner role has shifted from just being a requirements proxy to a strategic,…

7 months ago

Business Value: Crafting User Stories for Measurable Impact

Business Value: In the world of Agile development, the user story has long been the…

8 months ago

SAFe Scrum Master (SSM) Certification with FAQ and Tips

The SAFe Scrum Master certification has become one of the most sought-after credentials for Agile…

1 year ago

PSK Practice Exam Practice Mode Questions

The Professional Scrum with Kanban (PSK) course enhances your organization's ability to deliver value efficiently…

1 year ago

Effective User Interviews in Scrum Framework

Effective User interviews play a crucial role in Scrum methodology, helping Product Owners and Scrum…

1 year ago

User Research Tools and Techniques for Product Owners

Product Owners should be well-versed in various user research tools and techniques to effectively understand…

1 year ago