System abend

SD37: Primary space full, no secondary

An SD37 abend means a data set filled its primary space and couldn't grow, because no secondary space amount was given when it was created. Message IEC031I D37-04 names the data set.

Also written as D37, SD37-04, D37-04, abend D37, system abend D37, ABEND=SD37, x37 abend.

What it means

The SPACE parameter has two amounts. The primary amount is allocated when the data set is created. The secondary amount is what the system adds, one extent at a time, when the primary fills. If the secondary amount is zero or missing, as in SPACE=(CYL,10), the data set can never be bigger than its primary space. When a program tries to write past that point, the system has nothing to ask for and ends the step with system completion code D37.

The volume may have plenty of free space. That doesn't matter, because the data set isn't allowed to ask for more. In an SB37, by contrast, the data set did ask and the space wasn't there.

CodeMessageWhat happened
SB37IEC030IThe data set asked for another extent and couldn't get one on its volume, and it had no other volume to move to
SD37IEC031IThe primary space filled and no secondary space was ever requested, so the data set couldn't ask for more
SE37IEC032IThe data set had already used every volume or extent it is allowed. A full PDS is the classic case

Message IEC031I gives the code and reason with the job, step, DD name, volume and data set name. Reason code 04 is the one you'll nearly always see, and it means exactly the case above.

Common causes

  • SPACE was coded with no secondary amount, such as SPACE=(TRK,15).
  • The data set was created long ago, through ISPF or a utility step, with a secondary amount of 0. Jobs that write to it with DISP=OLD or DISP=MOD have now filled it.
  • The input grew, and the primary amount that used to be enough no longer is.
  • A PDS created with no secondary amount has filled up as members were added or replaced.
  • A loop in the program wrote far more records than it should.

How to find the problem

  1. Read IEC031I for the DD name and the data set name.
  2. Look at SPACE on that DD. If there's only one amount, or the second amount is 0, that's the cause.
  3. If the job writes to an existing data set, check it in ISPF option 3.4 with the I line command. A secondary amount of 0 confirms it.
  4. Compare the records written with a normal run. If the output is far larger than usual, look for a loop or a change in the input.

How to fix it

  • Add a secondary amount. SPACE=(CYL,(10,5),RLSE) starts at 10 cylinders and can grow by 5 at a time, and RLSE returns what isn't used.
  • For an existing data set with no secondary, allocate a new one with a secondary amount, copy the data across with IEBGENER or ISPF option 3.3, then rename the two.
  • For a PDS, compress it first, which may free enough space. If it's still full, reallocate it with a secondary amount and copy the members across.
  • Make a secondary amount part of your JCL standards, so new jobs don't repeat the problem.
  • Rerun from the failed step once the data set has room, deleting or recreating any partly written output first.

What it looks like

IEC031I D37-04,IFG0554P,ACCTLD01,STEP010,EXTRACT,0A61,WRK009,TEST.ACCT.EXTRACT
IEA995I SYMPTOM DUMP OUTPUT
  SYSTEM COMPLETION CODE=D37  REASON CODE=00000004
IEF450I ACCTLD01 STEP010 - ABEND=SD37 U0000 REASON=00000004

Questions

Why do I get SD37 when the disk has free space?

Because the data set has no secondary space amount, it isn't allowed to ask for any of that free space. Add a secondary amount to SPACE.

What is the difference between SD37 and SB37?

SD37 means the data set had no secondary amount, so it couldn't ask for more space. SB37 means it did ask, but the volume was full or the data set had hit its extent limit.

Will a bigger primary amount alone fix SD37?

It fixes today's run, but the data set still can't grow past that size. Adding a secondary amount is the lasting fix.