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.
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.
| Layer | Example | Scope |
|---|---|---|
| Options Table BUFNO | BUFNO 2 site default | All programs unless overridden |
| FILE statement | FILE PAYIN FB(150 1500) BUFNO 10 | That file in program |
| JCL DCB | //PAYIN DD DCB=(BUFNO=15,...) | Input files only at execution |
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.
12345678* 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 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.
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.
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.
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.
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.
1. Default BUFNO for sequential files is often:
2. For INPUT files BUFNO precedence is:
3. For OUTPUT sequential files JCL BUFNO is:
4. BUFNO does not apply to:
5. Many files with BUFNO 5 can cause: