z/OS message

IEC031I: D37 abend, primary space full and no secondary

IEC031I means a data set opened for output filled all of its primary space and had no secondary space to grow into, so z/OS ended the step with system abend D37. IBM documents only one return code for it, 04.

Other names for this code

Also written as IEC031I D37-04, D37-04, abend D37, SD37, IEC031I, D37 abend, system abend D37.

What it means

Every new disk data set gets a primary amount of space when it is created. The SPACE parameter can also ask for a secondary amount, which z/OS adds in extra extents when the primary space fills up. If the SPACE parameter gave a primary amount and nothing else, the data set can't grow at all.

When a program writing such a data set reaches the end of its primary space, z/OS has nowhere to put the next block. It writes IEC031I and ends the step with abend D37 and return code 04. IEF450I follows with ABEND=SD37 and REASON=00000004. The step ends unless the program has a DCB abend exit that chooses to ignore the error. In that case z/OS tries to close the file before handing control back.

The message fields are the same as in the other end-of-volume space messages. In order, they are the abend and return code, the module that found the problem, the job name, step name and DD name, the device number, the volume serial, a DADSM extend diagnostic code if one is available, and the data set name with any member. A hyphen and a number after the DD name mean the failing data set was not the first one in a concatenation.

Common causes

  • The DD statement asked for primary space only, for example SPACE=(TRK,10), and the step wrote more than ten tracks.
  • An existing data set that was created without a secondary amount is being added to with DISP=MOD, and the new records don't fit.
  • The space came from an SMS data class or a model data set that gave no secondary amount, and the JCL didn't supply one.
  • The input grew past what the primary amount was sized for.
  • A program loop kept writing until the primary space ran out.

How to find the problem

  1. In SDSF, open the job's JESYSMSG and find IEC031I. Note the DD name and the data set name.
  2. Find that DD statement in the step's JCL. The JESJCL listing shows procedures expanded, so you can see the SPACE parameter that was really used.
  3. Look up the data set in ISPF option 3.4 with the I line command. It shows the primary and secondary amounts. A secondary of zero confirms the cause.
  4. If the step has no SPACE parameter, the space came from the SMS data class. Ask the storage team which data class was assigned and what space it gives.
  5. Compare the number of records written with a previous good run. A sudden jump points to bad input or a loop rather than normal growth.

How to fix it

  • Add a secondary amount to the SPACE parameter, for example SPACE=(CYL,(10,5),RLSE).
  • Raise the primary amount too if the file is regularly bigger than it.
  • For an existing data set with no secondary, allocate a new one with a secondary amount, copy the data across, then rename it to the old name.
  • Delete any partial output before rerunning if the step kept it, so the rerun doesn't hit a duplicate data set name.
  • If a loop caused it, fix the program first.

IBM documentation

IBM documentation: IEC031I. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Is D37 always a JCL problem?

Almost always. The data set was created without a secondary amount. The fix is in the SPACE parameter or the data class, unless the program wrote far more than it should have.

What is the difference between D37 and B37?

D37 means there was no secondary amount at all. B37 means a secondary amount existed but z/OS still couldn't extend, for example because the data set reached 16 extents or the volume was full.

Can I rerun from the failed step?

Yes. Fix the SPACE parameter, delete the partial output if it was kept, then restart from the failed step with RESTART= on the JOB statement.