Performance best practices are the habits experienced mainframe teams use after they understand what Easytrieve can do—not random tweaks copied from old JCL. A nightly payroll extract that grew from two million to twenty million records may still finish in the window if you eliminate per-record DISPLAY, right-size sequential buffers, and avoid sorting data you already sorted upstream. Conversely, raising BUFNO on every FILE without measurement can cause storage abends that never appeared in test. Broadcom documents environmental options, Virtual File Manager behavior, and sort work files; SMF and job accounting tell you whether elapsed time waits on disk, CPU, or sort. This page gives beginners a tuning workflow: classify the bottleneck, apply the highest-impact low-risk changes first, validate in a controlled test region, and document what changed for operations. It complements the performance section tutorials on I/O, CPU, memory, sort optimization, and large datasets with production-minded do and do-not guidance.
Every tuning story starts with baseline numbers: job elapsed time, CPU seconds, EXCP counts, and sort messages. If EXCP dominates and CPU is low, you are likely I/O-bound—buffering, file design, and reducing passes over data help first. If CPU is high with modest I/O, look at expressions in tight loops, table searches, and unnecessary conversions. If sort steps or WORK file allocations spike, focus on keys, duplicate handling, and whether presorted input eliminates an internal sort. Changing twenty options without classification wastes change-control cycles and can regress a stable job. Capture before and after in a tuning log the operations team can read six months later.
| Symptom | Likely cause | First action |
|---|---|---|
| High EXCP, low CPU | Sequential or VSAM I/O | Review BUFNO on hot QSAM files; reduce extra passes |
| SORT messages, large WORK datasets | Sort-bound | Presort upstream; tighten SORT keys; drop unneeded fields |
| High CPU, moderate I/O | Logic in inner loop | Remove DISPLAY; simplify expressions; binary search tables |
| VFM or temp space waits | VIRTUAL file pressure | Review VFMSPAC; reduce retained VIRTUAL size |
| Long report phase only | Report work file or control breaks | See report tuning tutorial; minimize LINE work |
Sequential FILE definitions accept environmental options including BUFNO—the number of buffers for QSAM reads and writes. A higher BUFNO can reduce physical reads when the job scans the same large file once sequentially. It is not free: each buffer consumes memory below the 16 MB line in classic AMODE31 load modules, and dozens of files with BUFNO 255 can exhaust storage. Best practice: identify the one or two largest input files, test BUFNO incrementally (for example 5, 10, 20), and stop when elapsed time flattens. VSAM files use different mechanisms; blindly copying BUFNO from a colleague's sequential job helps nothing on KSDS. Avoid reading the same file multiple times in one job when a single pass with WORK file or SORT can produce both detail and summary outputs.
1234FILE INPUT-FILE FILE INPUT-FILE FIELDS BUFNO 10
Place BUFNO on the FILE environmental options where your release documents it—verify against your Broadcom manual because syntax varies slightly by version. Combine with sensible BLKSIZE and dataset organization chosen at allocation time, not only in Easytrieve source.
VIRTUAL files store intermediate data in Virtual File Manager temporary space. They simplify program logic when you need scratch ordering or multiple passes without permanent datasets. Under load, VFM contention slows every job on the LPAR. Best practices: allocate adequate VFMSPAC in startup or job PARM, delete virtual files when no longer needed, and prefer direct sequential WORK datasets for very large scratch when operations standards allow. Monitor temp space during peak batch windows before adding new VIRTUAL-heavy programs to the schedule.
SORT activities and SORT statements inside jobs consume CPU and disk for keys and merge passes. Presorting extract files in a dedicated DFSORT step often beats repeated internal sorts across similar jobs. When you must sort inside Easytrieve, specify only necessary key fields—extra key bytes increase work. DUP handling choices affect whether you process duplicate keys twice or collapse them early. WORK file space in REPORT activities can explode when control breaks multiply; design break levels deliberately. See sort optimization and multi-key sorting tutorials for field-level detail.
DEBUG and FLOW options belong in development compiles. Shipping DEBUG FLOW to production multiplies overhead and fills listings operators ignore until disk fills. Use controlled test jobs with limited input when tracing logic.
Compiler optimization options (site-specific names vary by release) trade compile time and listing detail for tighter generated code. Standardize production compile procedures with optimization enabled after regression test. Cross-reference and map listings help performance work indirectly by finding dead fields and accidental duplicate definitions that bloat work storage. Keep listing options that operations require for audit, but do not enable every diagnostic in nightly production rebuilds without reason.
Batch report generators spend much time in REPORT activities building lines and control breaks. Minimize arithmetic in BEFORE-LINE when AFTER-BREAK can accumulate once per group. Online SCREEN programs pay terminal I/O and conversational overhead—performance tuning targets round trips and file GET counts in BEFORE-SCREEN, not BUFNO on batch files. Match tuning technique to program type; batch habits pasted onto CICS-backed screens misallocate effort.
Performance tuning is making sure the delivery truck takes the fast road without breaking the bridge. First you watch whether the truck is slow because of traffic (disk reads), heavy boxes (sorting piles), or the driver checking every single box out loud (DISPLAY). You fix the biggest problem first—maybe take a highway with more lanes (buffers)—but you do not add a hundred lanes if the bridge collapses (memory abend). You measure, change one thing, and see if the truck arrives earlier before changing everything else.
1. First step in performance tuning should be:
2. BUFNO on FILE primarily affects:
3. Excessive DISPLAY in JOB INPUT loops:
4. VIRTUAL files depend on:
5. Internal SORT versus presorted input: