Design patterns are named, repeatable ways to structure Easytrieve programs that solve problems your site hits again and again. Insurance firms generate control-break premium reports; banks copy reconciliation files between regions; retailers validate POS extracts before loading warehouses. Each problem has a skeleton: which activities to use, where validation lives, how errors exit, how reports share TITLE and footing macros. Patterns are not Broadcom syntax—they are organizational knowledge expressed in Easytrieve building blocks (JOB, REPORT, PROC, macros, SORT, FILE). This overview maps the pattern catalog in section 29, explains when to choose each pattern, shows how patterns connect to best practices and modular design, and gives beginners a decision path before opening the dedicated pattern pages. Treat patterns as templates to adapt, not copy-paste without thought for your file layouts and schedule constraints.
Best practices tell you to name fields clearly and measure before tuning BUFNO. Design patterns tell you how to lay out a validation-heavy inbound feed: macro for FILE layout, INIT procedure to load codes table, PERFORM VALIDATE-RECORD with error file WRITE, separate PERFORM for transform. Practices are principles; patterns are blueprints. You need both—patterns implemented with sloppy names still hurt maintainability.
| Pattern | Problem it solves | Deep dive page |
|---|---|---|
| Reusable report framework | Many similar listing reports with shared headers/footers | reusable-report-framework |
| Validation framework | Inbound feeds with invalid records routed to exception files | validation-framework |
| Batch processing | Multi-step read-transform-write nightly jobs | batch-processing |
| Error handling | Consistent counters, messages, and stop/continue rules | error-handling |
| File copy utility | Format-preserving or light-touch copy between datasets | file-copy-utility |
| Control break processing | Subtotals and headings when keys change | control-break-processing |
| Lookup tables | Code-to-description and rate tables at runtime | lookup-tables |
| Reusable procedures | Shared PERFORM libraries within application areas | reusable-procedures |
Start from outputs and failure modes. If operations needs a formatted listing with standard corporate headers, start with reusable report framework. If data quality dominates—half the feed has bad store numbers—validation framework plus error handling pattern. If the job is mostly moving and filtering records without complex report formatting, batch processing or file copy utility may suffice. If users ask for subtotals by region and department, control break processing. Reference data scattered across codes in input files points to lookup tables. Multiple programs share the same tax CALC PERFORM blocks—reusable procedures pattern inside modular design standards.
A nightly retail sales job might chain patterns as follows. Batch processing pattern defines JOB INPUT reading POS extract, PERFORM VALIDATE-LINE (validation framework), PERFORM ENRICH-SKU via table LOOKUP (lookup tables), WRITE clean work file. Second step REPORT activity uses control break processing on STORE-NUM with reusable report framework macros for TITLE and footing. Error handling pattern increments BAD-COUNT and writes SALES.EXCEP file rows with reason codes. One real job implements several patterns; the overview helps you name what you are building when documenting in change tickets.
123456789101112131415161718JOB INPUT POS-FILE PERFORM VALIDATE-LINE IF RECORD-OK PERFORM ENRICH-FROM-SKU-TABLE WRITE CLEAN-FILE ELSE PERFORM LOG-EXCEPTION END-IF END REPORT SALES-RPT BREAK-LEVEL STORE-NUM BEFORE-BREAK. PROC PERFORM RESET-STORE-ACCUM END-PROC AFTER-BREAK. PROC PERFORM PRINT-STORE-SUBTOTAL END-PROC
Patterns often ship as macro libraries plus PROC skeletons. Report framework macros generate TITLE and PAGE hooks; validation framework supplies VALIDATE-HEADER and VALIDATE-DETAIL procedure stubs developers fill with field rules. Keep pattern artifacts in a governed library with version numbers. Teams customize inside designated PROC bodies without editing macro core each time—extension points are part of good pattern design.
Design patterns are like cookie cutters for programs. You have a star cutter for holiday reports and a round cutter for simple lists. The dough (your data) changes, but the shape (structure) is already known to work in the oven (batch window). You do not invent a new cutter for every cookie unless the cookie is truly weird. Patterns save time and make cookies look like they came from the same bakery.
1. A design pattern in Easytrieve is:
2. Validation framework pattern typically separates:
3. Lookup table pattern fits when:
4. Control break processing pattern uses:
5. Patterns differ from best practices because patterns: