Easytrieve File Buffering — BUFNO Tuning

File buffering is the first performance lever many Easytrieve batch programmers pull because it is easy to code—BUFNO 10 on a FILE statement—and often dramatically cuts EXCP on large sequential scans. BUFNO controls how many blocks the runtime keeps in memory per sequential file so repeated reads do not wait on physical disk for every record. Default two buffers from Options Table suffices for small files; million-row payroll masters benefit from higher values after measurement. The lever has limits: BUFNO does not apply to VSAM or VFM per Broadcom environmental options; output files ignore JCL BUFNO; and raising BUFNO on twenty simultaneous files can exhaust below-the-line storage when AMODE31 dynamic allocation maps buffers under 16MB. Input precedence differs from output—JCL wins for input, FILE wins for output. This page teaches BUFNO range 0–255, three configuration layers, precedence tables, BLKSIZE interaction, AMODE31 storage placement, experimental tuning method, VSAM alternative buffering, and when buffering cannot fix design problems like reading the same file four times in separate JOB activities.

Progress0 of 0 lessons

What BUFNO Does

Each buffer holds one block of data read or written for a sequential file. Multiple buffers allow read-ahead: while your program processes records from buffer one, I/O subsystem fills buffer two. Write path similarly pipelines block output. Diminishing returns appear when buffers exceed what sequential scan can consume before file end—measure rather than assume 255 is optimal.

Three Places to Set BUFNO

BUFNO configuration layers
LayerExampleScope
Options Table BUFNOBUFNO 2 site defaultAll programs unless overridden
FILE statementFILE PAYIN FB(150 1500) BUFNO 10That file in program
JCL DCB//PAYIN DD DCB=(BUFNO=15,...)Input files only at execution

Input Versus Output Precedence

Broadcom knowledge article 54905 documents different parse rules. Input files: JCL DCB BUFNO if present; else FILE BUFNO; else Options Table. Output files: JCL ignored; FILE BUFNO; else Options Table. Beginners set JCL BUFNO on output DD wondering why behavior unchanged— move BUFNO to FILE for output datasets.

text
1
2
3
4
5
6
7
8
* Source FILE PAYIN FB(150 1500) BUFNO 8 FILE PAYOUT FB(150 1500) BUFNO 12 * JCL — BUFNO on PAYIN DD overrides FILE 8 if coded //PAYIN DD DSN=PAYROLL.IN,DISP=SHR,DCB=(BUFNO=20,...) //POUT DD DSN=PAYROLL.OUT,DISP=(NEW,CATLG) * POUT JCL BUFNO ignored — uses FILE BUFNO 12

FILE Statement Syntax

FILE Statement documents BUFNO 1 to 255 for MVS. Value establishes buffer count allocated for that file definition. Pair with realistic FB BLKSIZE—buffer size follows block structure; mismatched BLKSIZE in FILE versus JCL DCB causes confusion unrelated to BUFNO count.

Experimental Tuning Method

  1. Baseline job with default BUFNO—record EXCP and elapsed.
  2. Double BUFNO on largest input file only; re-run same input.
  3. If EXCP drops materially and no storage abend, iterate upward.
  4. Repeat for heavy output file using FILE BUFNO.
  5. Stop when marginal EXCP reduction per buffer added is small.

AMODE31 and Below-the-Line Storage

When many files carry elevated BUFNO, total dynamic buffer storage grows. Options Table AMODE31 controls whether dynamic allocations sit above or below 16MB line. Article 16520 describes program that abended below-the-line after BUFNO 5 on all sequential files—linked AMODE 31 RMODE ANY with AMODE31=NO placing buffers below line. Coordinate with systems programming before mass BUFNO change on large multi-file programs.

VSAM and VFM Exceptions

Environmental options explicitly state VFM and VSAM files do not use BUFNO. VSAM buffering uses AMP parameters in JCL or cluster CI size tuning. VIRTUAL files use VFM paths—see performance overview VFM section. Applying BUFNO to VSAM FILE definition does not help sequential browse performance.

BUFNO Versus Design Changes

Buffering cannot eliminate extra pass when JOB reads file, SORT writes work, second JOB reads again—design merge may dominate. Presort SELECT, combined activities, or indexed lookup versus full scan are architectural wins BUFNO alone cannot deliver.

Common File Buffering Mistakes

  • BUFNO on VSAM expecting same effect as QSAM.
  • JCL BUFNO on output wondering why FILE value still applies incorrectly—output ignores JCL.
  • Maximum BUFNO everywhere causing storage abend.
  • Tuning BUFNO on tiny control file with ten records—no measurable gain.
  • Ignoring BLKSIZE mismatch while tuning buffers.
  • Not re-measuring after LPAR storage parameter changes.

Explain It Like I'm Five

BUFNO is how many armfuls of papers you carry from the file cabinet at once. Two armfuls means many trips; ten armfuls means fewer trips but your arms get full—too many armfuls for every drawer at once and you cannot hold them all. Input homework can also say in JCL how many armfuls; output homework only listens to the FILE line.

Exercises

  1. Add BUFNO 10 to largest input FILE; document precedence with JCL DCB.
  2. Explain why output ignores JCL BUFNO in one paragraph.
  3. List three file types BUFNO does not help.
  4. Design tuning experiment with baseline and one-variable BUFNO change.
  5. Describe AMODE31 relevance when adding BUFNO to fifteen files.

Quiz

Test Your Knowledge

1. Default BUFNO for sequential files is often:

  • 2 from Options Table unless overridden
  • 255 always
  • 0 only
  • Not applicable

2. For INPUT files BUFNO precedence is:

  • JCL, then FILE statement, then Options Table
  • FILE only
  • Options Table only
  • REPORT TITLE

3. For OUTPUT sequential files JCL BUFNO is:

  • Ignored—FILE then Options Table
  • Always used first
  • Required in TITLE
  • Same as input

4. BUFNO does not apply to:

  • VSAM and VFM files per environmental options
  • All QSAM files
  • Every DD statement
  • SYSPRINT

5. Many files with BUFNO 5 can cause:

  • Below-the-line storage exhaustion when AMODE31 dynamic allocation below 16MB
  • Faster compile only
  • Automatic SORT disable
  • CICS transaction abend
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Environmental Options BUFNO; Articles 54905 and 16520Sources: Broadcom FILE Statement, Environmental Options, Performance tuning tipsApplies to: Easytrieve BUFNO sequential file buffering