Easytrieve Large Dataset Processing

Large dataset processing is where Easytrieve programs earn their reputation—either as reliable nightly workhorses or as month-end bottlenecks. The language makes it easy to read an entire master file, sort it, and print three reports in one step. That convenience becomes expensive when the master grows from fifty thousand rows to five million. Successful teams treat scale as a design requirement: reduce rows early, avoid duplicate sorts, route heavy report spool to work files, size REGION realistically, and split work when business rules allow parallel jobs. This tutorial connects Broadcom performance guidance to concrete patterns beginners can apply on the next maintenance ticket.

Progress0 of 0 lessons

Scale Problems Versus Logic Bugs

A program that passes a ten-row test may fail at scale with storage abends, sort work space errors, or multi-hour elapsed times while still being logically correct. Separate the two during triage: if small data succeeds and large data fails, suspect volume-driven limits (REGION, VFM, SORTWK, BUFNO). If wrong totals appear at any size, fix logic first. Large-dataset tuning never compensates for incorrect BREAK levels or missing EOF tests.

Record length times row count estimates bytes moved even when logic is simple: a 400-byte FB master at three million rows moves over a gigabyte through read buffers before SORT or PRINT duplicates data in work files. Capacity planning starts with that arithmetic, then adds TABLE initiation, VFM spill, and report WORKFILE growth—not with guessing at REGION values.

Reduce Volume Before Expensive Activities

Broadcom repeatedly recommends SELECT to filter records before SORT and before REPORT processing. Every row removed before sort avoids compare operations and work data set I/O. In JOB activities, code SELECT on the input file when business rules allow— for example only active accounts or current-period transactions. For SORT activities, use BEFORE SELECT so the sort utility never sees excluded rows. Pair filtering with accurate SIZE estimates when you must code SIZE on SORT for external input files.

Combine business filters in one BEFORE PROC rather than SORT then JOB DELETE patterns that still paid sort cost for dropped rows. If thirty percent of master rows are inactive status, prescreening removes them before compare operations—roughly thirty percent fewer sort records and less VFM spill. Keep BEFORE logic tight: expensive field conversions on every row can rival sort savings. Upstream COBOL or ETL extracts should drop expired policies and zero-balance lines when rules allow so Easytrieve never sees those bytes.

text
1
2
3
4
5
6
SORT WORKFILE USING INPUT-FILE BEFORE SELECT ACTIVE-FLAG EQ 'Y' SORTKEY REGION SORTKEY ACCOUNT JOB INPUT WORKFILE PRINT DETAILRPT

External Extract and Presort Pipelines

Data warehouse and finance pipelines often run DFSORT or Syncsort once to build a clean, ordered extract consumed by several Easytrieve programs. That pattern moves sort tuning into a dedicated step with familiar control cards while Easytrieve focuses on reporting and light transforms. When the extract is already sorted, omit Easytrieve SORT activities and avoid SEQUENCE on every report if keys match the file order—verify with test counts because equal-key ordering is not guaranteed unless you add tie-break keys.

SIZE on SORT inside Easytrieve still matters when input did not come from a prior activity that supplies count inference—use peak record count plus growth margin, not last week's small test file. One shared DFSORT on the full GL extract amortizes ordering cost across three downstream Easytrieve programs that would otherwise each SORT or SEQUENCE independently. Document which keys the extract carries so maintainers do not add redundant SEQUENCE on identical keys in every REPORT block during the next enhancement.

Splitting Logical Datasets

Performance articles suggest breaking huge files into smaller logical datasets when partitions align with business structure—by company, region, or ledger. Each partition runs in its own job with smaller REGION and shorter elapsed window. Operations gain restart granularity: a failure in region West does not block region East. Design merge or balancing steps if corporate totals must reconcile across partitions.

Scaling strategies compared
StrategyBenefitTradeoff
SELECT earlyFewer rows through sort/reportMust prove filter matches business rules
External presortShared sort cost across programsExtra JCL step and disk for extract
Partitioned jobsParallel elapsed time, smaller regionsReconciliation and scheduling complexity
WORKFILE reportsLess VFM pressure on huge PRINTMore temporary disk allocations
Keyed READ subsetAvoid full master scanRequires indexed organization and key design

Keyed Access on Large VSAM Files

When you need hundreds of records from a million-record KSDS, sequential GET through the entire file wastes I/O. Use READ with keys, POINT/GET patterns, or indexed TABLE files where SEARCH maps to keyed access. Define STATUS and test FILE-STATUS after each operation during development. For random key batches, consider whether a small driver file listing keys processed in Easytrieve is cheaper than repeated full scans.

KSDS buffer tuning (BUFNI, BUFND, CISZ) lives in JCL and cluster definition—operations owns those values. Application developers supply key order in driver files and avoid accidental full scans in JOB loops. When reference data exceeds TABLE limits near 32767 entries, KSDS is the standard Broadcom recommendation instead of forcing max-entries higher. Random GET on two million input rows against a well-buffered KSDS may still beat TABLE that cannot initiate at all.

VSAM KSDS Versus TABLE Beyond 32767 Entries

TABLE loads entirely at initiation with binary SEARCH at runtime—excellent for hundreds or a few thousand static rows. Requesting max-entries 100000 may fail compile, initiation, or load depending on release and options. Postal codes, SKU catalogs, and customer cross-reference files beyond the classic limit belong in FILE XREF KSDS with KEY and GET in JOB logic. Db2 SQL FILE suits relational, shared, or intraday-changing reference data. The decision is not only row count: change frequency, sharing across programs, and lookup pattern (many SEARCH per row versus one GET) all matter.

text
1
2
3
4
5
6
7
8
9
10
11
12
13
FILE PRODXRF KSDS KEY SKU-NO A 15 DESC A 40 PRICE W 7 P 2 JOB INPUT ORDERS GET PRODXRF KEY ORDER-SKU IF NOT PRODXRF MOVE 'UNKNOWN SKU' TO PROD-DESC ELSE MOVE DESC TO PROD-DESC MOVE PRICE TO LINE-PRICE END-IF

Table SEARCH Cost at Million-Row Scale

Binary SEARCH on ten thousand TABLE rows needs at most fourteen compares per call—negligible once. Multiply by six SEARCH calls on two million input rows and you execute twelve million searches per run before PRINT formatting. Cutting calls from six to three saves more than doubling max-entries on a table already under five thousand rows. Audit SEARCH frequency per input record during code review, not just table row count. Consolidate decodes, cache repeated keys in W fields, and gate DISPLAY in lookup PROC. INSTREAM tables remove external load I/O but not byte multiplication at initiation.

Link-Edit Execute Versus Compile-and-Go on Full Files

Compile-and-go compiles SYSIN then processes the full file in one step—compiler tables and listing buffers share REGION with FILE buffers, TABLE initiation, VFM, and report work files. Production large jobs should run PGM=loadmodule from PARM LINK and IEWL link-edit, with source changes promoted through separate build steps. Compile-and-go remains valuable for emergency fixes tested on truncated input, not for recurring peak volume. Link-edit also separates compile SYSPRINT noise from runtime messages operations archive nightly.

REGION, EZTVFM, and WORKFILE Together

Large jobs usually need combined memory tactics: REGION=0M per release guidance, adequate EZTVFM space (VIO or work DASD per site standards), WORKFILE on the largest REPORT statements, and WORKFSPA cylinder counts aligned with report width and break levels. Treat these as one design rather than isolated JCL tweaks—changing only REGION while leaving three huge VFM-only reports may still fail.

Testing at Scale Without Production Risk

Build synthetic test files that mirror production layout but use masked or generated values—see the test data tutorial. Grow volume in steps: ten thousand, one hundred thousand, one million rows. Capture SMF or job step timings at each step to find the knee where elapsed time jumps nonlinearly. That knee usually marks sort spill, VFM overflow, or buffer underrun—not a mystery compiler bug.

Separate regression tests for logic (small fixed files) from capacity tests (scaled volume). Running only ten-row tests before month-end promotion misses REGION and EZTVFM failures that appear only at calendar-close row counts. Archive one anonymized peak-month input generation for repeatable TEST LPAR runs. Compare compile-and-go versus load module execute at each volume step because compiler storage can mask runtime headroom on small files while failing together at scale.

I/O and Sequential Scan Volume

Large sequential scans are often I/O-bound when BUFNO is low or input resides on remote tape. Easytrieve logic may be trivial while EXCP counts soar. Operations tunes BUFNO on DD statements; developers ensure FILE record length matches DCB reality. Multiply record length by row count for bytes moved: two million rows at 350 bytes FB moves roughly seven hundred megabytes through buffers even before SORT or PRINT duplication. Named checkpoint datasets let operations restart REPORT after printer failure without re-reading the raw master—trading catalog footprint for window recovery time.

Large Dataset Anti-Patterns

Patterns that fail at scale
Anti-patternOutcome
TABLE for million-row vendor cross-referenceInitiation failure or memory ABEND
SORT full file then JOB drops ninety percentPaid sort for discarded rows
Twelve SEARCH per row on two million recordsCPU window overrun
Compile-and-go on month-endCompiler plus runtime REGION stress
Detail PRINT every column for all rows to SYSOUTPrint pipeline bottleneck

Monitoring and Operational Handoff

Document expected record counts, REGION, WORKFILE usage, and sort work DD names in the run book. Operations can then compare tonight's job against baselines. When month-end growth exceeds forecast, proactive capacity review beats emergency REGION bumps during the close window.

Include in the run book: load module name and library, EZTVFM SPACE formula used, list of TABLE files with max-entries and last verified row counts, whether presort JCL runs upstream, and SEARCH call count per input row from last code review. New maintainers inherit volume assumptions only if documentation states them explicitly—otherwise every enhancement risks adding another SEQUENCE or TABLE without measuring cumulative effect on the batch window.

Explain It Like I'm Five

Imagine sorting a whole school cafeteria when you only need the third-grade lunch orders. Large dataset processing is about handing the kitchen only third-grade trays before anyone starts counting and stacking. If the job is still too big, split grades into separate lines so each line moves faster, then add the totals at the end.

If you ask the teacher eight questions about every single lunch tray (SEARCH), you never finish lunch—even when each answer is quick. One big sort at the start (DFSORT) is like lining everyone up in order once so every class can walk through without reshuffling the whole cafeteria. The finished project from link-edit is lighter than carrying the instruction manual on every field trip.

Exercises

  1. Sketch a pipeline with DFSORT extract followed by Easytrieve JOB without SORT.
  2. Write a BEFORE SELECT clause that removes inactive rows before SORT.
  3. Propose two partition keys for splitting a national sales master file.
  4. List metrics you would capture when doubling input record count in test.
  5. Decide keyed READ versus full scan for ten keys against a five-million record KSDS.

Quiz

Test Your Knowledge

1. The first step before tuning a large Easytrieve job is usually:

  • Measure with production-like record counts on a test LPAR
  • Delete half the input records
  • Remove all REPORT statements
  • Disable SYSPRINT

2. SELECT before SORT primarily helps large jobs by:

  • Reducing rows that enter sort and report processing
  • Increasing BLOCKSIZE automatically
  • Eliminating JCL DD statements
  • Converting VSAM to sequential

3. Breaking one huge file into logical datasets helps when:

  • Different downstream programs need subsets that can run in parallel
  • You want to avoid defining any FILE statements
  • All records must stay in one TABLE
  • SCREEN maps are unused

4. Pre-sorting a shared extract in DFSORT before multiple Easytrieve programs:

  • Amortizes sort cost across consumers
  • Is never recommended by Broadcom
  • Replaces the need for FILE definitions
  • Works only for SCREEN programs

5. For a few keyed lookups in a massive VSAM file, prefer:

  • READ or GET with keys rather than a full sequential pass
  • Loading the entire file into a TABLE
  • Removing STATUS checks
  • Doubling REPORT TITLE lines

Frequently Asked Questions

What counts as a large dataset in Easytrieve?

There is no single row threshold—it is when your job approaches region limits, EZTVFM overflow, unacceptable batch window time, or sort work space failures. A million-row sequential file may be routine on one LPAR and problematic on another with tight REGION and old DASD.

Should I always use external sort for big files?

Not always. External DFSORT or Syncsort steps shine when the sorted extract is shared or when Easytrieve SORT would repeat inside every program. A single REPORT needing modest SEQUENCE on a pre-filtered subset may stay entirely inside Easytrieve economically.

How does WORKFILE help large reports?

Large reports generate substantial intermediate spool. WORKFILE moves that data to sequential work datasets instead of relying on VFM alone, which reduces memory pressure and EZTVFM contention documented in Broadcom performance articles.

Can I parallelize one Easytrieve program across multiple jobs?

Often yes at the architecture level: split input by key range, region code, or date partition into separate files and run multiple jobs with SELECT on each slice. Each job needs smaller REGION and finishes sooner; operations must coordinate restart and merge rules.

What JCL change helps large Easytrieve 11.6 modules?

Broadcom release notes recommend REGION=0M because EZTCOM module size grew. Combine with adequate EZTVFM space and tuned WORKFSPA for report-heavy jobs.

Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve best practices SELECT before sort, WORKFILE, REGION=0M, performance KBSources: Broadcom Using Best Practices, performance article 28459, Code Efficient ProgramsApplies to: Easytrieve batch jobs processing high-volume sequential and VSAM files