MainframeMaster

JCL SPACE & BLKSIZE calculator

Use this when you need to calculate the SPACE= and BLKSIZE= parameters in JCL for a new dataset. Use the defaults as a starting point and adjust the values such as the Record Length (LRECL) and Record Format (RECFM) as needed.

How to use it

  1. Start with a preset if it matches your file (FB 80 is a fairly standard default), or fill the fields yourself.
  2. Set record format (RECFM) and record length (LRECL). For most fixed files that is FB and something like 80 (but depends on how many bytes you need to store in each record).
  3. Enter how many records you expect, or switch the size input to MB if that is easier.
  4. Leave BLKSIZE on Optimal (half-track) unless your shop told you a specific value.
  5. Copy the sample DD at the bottom into your JCL, then change the dataset name to match your shop.

Device defaults to 3390 (what almost every system uses today).

SPACE & BLKSIZE calculator

Presets
Inputbytes

Using 27,920 bytes (half-track)

Inputrecs
Input%
Input%

Recommended BLKSIZE

27,920

Blocking factor

349 records/block

Blocks / track

2

Estimated file size (data)

781.3 KB (800,000 B)

Estimated allocated size

954.3 KB (977,200 B)

Records / track

698

Records / cylinder

10,470

Total blocks (w/ growth)

35

Estimated tracks

18

Estimated cylinders

2

Primary / secondary (TRK)

18 / 5

Sample DD

jcl
//NEWDD    DD DSN=USER.SEQ.DATA,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(18,5),RLSE),
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920),
//            DSORG=PS

SPACE=(TRK,(18,5),RLSE) · DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920)

How the numbers are built

Optimal BLKSIZE is half-track (27,998 bytes on 3390). For FB that means the largest multiple of LRECL that still fits. Tracks assume 15 tracks per cylinder and about 55,998 usable bytes per track. Primary SPACE is the first extent(s); each secondary grab usually adds another. Too many extents slow things down or land you in B37/D37. SMS, keys, extended format, and compression can change what you actually get. Use this to plan, then confirm on your system.

Need this at work?

Free account saves tutorial progress. The jobs board lists openings that ask for JCL.

JCL jobs on the board

What the results mean

  • BLKSIZE: how big each physical block on disk is. The optimal value packs the track efficiently so you waste less space.
  • SPACE primary / secondary: how much disk to reserve up front, and how much more to grab if the file grows. Each extra grab is usually another extent.
  • Sample DD: ready JCL lines with SPACE= and DCB= filled in from your answers.

Debugging notes (errors you may see)

If the job fails after you paste the DD, open JESYSMSG first. Look for IEC0xxI / IEC141I / IEF257I lines, then the matching system abend (SB37, SD37, SE37, S013). The job log usually prints only the short message ID line; the longer English explanation lives in the IBM manuals (and in ISPF / SDSF message help if your shop has it). Below: a typical log line, then IBM's meaning for the common return code.

B37 / SB37: not enough space on the volume

Raise primary/secondary, move to a freer volume, or allow more volumes. IBM associates return code 04 with end-of-volume when output space is gone.

text
1
2
3
4
5
6
7
8
9
10
IEC030I B37-04,IFG0554A,PAYROLL,STEP10,OUTDD,128C,TSO001,0427041D,USER.PAY.OUT IEF450I PAYROLL STEP10 - ABEND=SB37 U0000 REASON=00000004 IBM explanation (IEC030I, rc 04): The error occurred during end-of-volume. For an output data set, all space was used on the current volume and no more volumes were specified. On DASD this also covers: no more space on the volume, maximum extents reached (16 for basic-format / PDS; 123 for extended format / PDSE), maximum tracks per volume reached, or VTOC full.

D37 / SD37: primary full, no secondary

Classic cause: SPACE=(TRK,10) with no second number. Add a secondary quantity or size primary to cover the whole file.

text
1
2
3
4
5
6
7
8
IEC031I D37-04,IFG0554P,PAYROLL,STEP10,OUTDD,3390,TSO001,USER.PAY.OUT IEF450I PAYROLL STEP10 - ABEND=SD37 U0000 REASON=00000004 IBM explanation (IEC031I, rc 04): A data set opened for output used all the primary space, and no secondary space was requested. Change the JCL specifying a larger primary quantity or add a secondary quantity to the SPACE parameter on the DD statement.

E37 / SE37: no more volumes, extents, or PDS full

Size primary larger, add volumes, or recreate the PDS with more directory blocks if the directory is what filled.

text
1
2
3
4
5
6
7
8
IEC032I E37-04,IFG0554A,PAYROLL,STEP10,OUTDD,3390,TSO001,USER.PAY.PDS IEF450I PAYROLL STEP10 - ABEND=SE37 U0000 REASON=00000004 IBM explanation (IEC032I, rc 04): A data set opened for output used all space available to or on the current volume, and no more volumes were available. Common cases: not enough volumes on the DD; a PDS/VIO data set filled its single volume; or a PDS already used 16 extents.

S013 / IEC141I: BLKSIZE and LRECL do not fit

Fix the DCB, or leave BLKSIZE off / code BLKSIZE=0 on a new disk data set so the system can pick a valid block size.

text
1
2
3
4
5
6
7
8
9
10
11
12
13
IEC141I 013-20,IGG0191A,PAYROLL,STEP10,OUTDD,USER.PAY.OUT IEF450I PAYROLL STEP10 - ABEND=S013 U0000 REASON=00000014 * Bad example: RECFM=FB,LRECL=133,BLKSIZE=800 (800 is not a multiple of 133) IBM explanation (IEC141I 013-20): An OPEN was issued for a sequential data set using queued access. BLKSIZE is not a multiple of LRECL, or LRECL is 0 with RECFM=FB/FBS, or BLKSIZE is not at least four bytes greater than LRECL with RECFM=V. IBM explanation (IEC141I 013-34, related DCB clash): RECFM=V/VB with LRECL greater than BLKSIZE-4, or non-variable RECFM with LRECL greater than BLKSIZE, or BLKSIZE/LRECL unavailable so OPEN could not build buffers.

JCL / allocation parameter errors

These often show up before the step really runs. Fix the syntax or ask for space the volume can actually give (CONTIG fails when no single solid chunk exists).

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
IEFC621I EXPECTED CONTINUATION NOT RECEIVED IEFC630I UNIDENTIFIED KEYWORD IN THE SPACE FIELD IEF257I PAYROLL STEP10 OUTDD - SPACE REQUESTED NOT AVAILABLE IEF453I PAYROLL - JOB FAILED - JCL ERROR IBM explanation (IEF257I): In a DD statement, the SPACE parameter requested more tracks than were available on the requested direct access volume. Check the SPACE quantity; if it is valid, change the request to a different volume, then submit again. IBM explanation (IEFC621I): A continuation was expected (trailing comma on the previous JCL line) but the next line was missing or did not start in columns 1-16. IBM explanation (IEFC630I): A keyword on the JCL statement was not recognized (misspelled, misplaced equal sign, or a subparameter without its major keyword).

Estimate was low (same abends, different cause)

You still get B37/D37/E37 and the same IBM text, but the real file was bigger than the estimate (wrong record count, or VB records longer than assumed). Bump growth %, raise primary, fix the count, then rerun. Use RLSE after you know the real size, not instead of enough primary.

text
1
2
3
4
5
IEC030I B37-04,IFG0554A,PAYROLL,STEP10,OUTDD,3390,TSO001,USER.PAY.OUT IEF450I PAYROLL STEP10 - ABEND=SB37 U0000 REASON=00000004 Same IEC030I meaning as above. Before blaming the volume, re-check record count, average VB length, and the growth % you used in this tool.

Explanations above summarize IBM z/OS 3.1.0 message docs for IEC030I, IEC031I, IEC032I, IEC141I, IEF257I, IEFC621I, and IEFC630I. More on extents, RLSE, and recovery is in the SPACE allocation tutorial.

Explain it like I'm 5

A track is a shelf. A block is a box on that shelf. LRECL is how big one item is. BLKSIZE is how many items fit in one box. SPACE is how many shelves you reserve when you create the file.

Field cheat sheet

  • LRECL: length of one record in bytes. On VB/V this is the maximum (includes a 4-byte RDW).
  • RECFM: FB/F = fixed length. VB/V = variable length. The B means several records share one block.
  • Device: leave on 3390 unless you know you are on 3380.
  • SPACE unit: TRK (tracks) is fine for most files. CYL (cylinders) suits bigger ones.
  • Directory blocks: only for PDS. About 1 block per 5 members.
  • RLSE: give unused space back when the file is closed.

Half-track BLKSIZE examples (3390)

  • FB LRECL=80: BLKSIZE=27,920 (349 records/block)
  • FB LRECL=133: BLKSIZE=27,930 (210 records/block)
  • VB LRECL=255: BLKSIZE=27,998

Under SMS you can code BLKSIZE=0 and let the system pick. This page shows the number it usually lands on so you can size SPACE with eyes open.

FAQ

Related Pages

More detail

The SPACE allocation tutorial covers RLSE, CONTIG, ROUND, extents, and B37/D37. Other calculators live on /tools.