Maintainability is how easily a program can be understood, changed, and trusted five or fifteen years after it was written. Easytrieve report generators often run unchanged for years, then need a new withholding column the week a regulator publishes rules. If the source is a single unreadable block with copied FILE layouts and no test notes, that week becomes a month. Maintainable programs combine modular design, consistent naming and formatting, purposeful comments, change-control discipline, and regression habits so teams ship fixes with confidence. This page targets beginners who write working jobs but have not yet worked on-call when a payroll abend page operations at 3 AM. You will learn what to document, how to structure code for the next maintainer, how macro and PROC choices affect long-term cost, and how operations handoffs keep batch windows stable when staff rotate.
Unmaintainable Easytrieve looks fine until the original author leaves. Then every change risks breaking control totals, tax buckets, or GDG generation because nobody knows which counter field is authoritative. Audits ask when logic last changed and whether anyone tested it—copy-paste FILE definitions without library control fail both questions. Incident mean time to repair grows: on-call engineers grep for field names instead of opening a PROC named CALC-STATE-TAX. Enterprise TCO includes maintainer hours; upfront maintainability pays compound interest.
| Layer | Content | Audience |
|---|---|---|
| Program header comment | Purpose, owner, ticket refs, input/output datasets | Developers, auditors |
| Inline business comments | Regulatory rules, vendor quirks, break-level intent | Maintainers during edits |
| Runbook (wiki/ServiceNow) | JCL schedule, restart points, expected counts | Operations, on-call |
| Change ticket | Rationale, test evidence, rollback plan | Change control board |
| Macro library README | Parameter contract, version history | All macro consumers |
Start each production member with a fixed header block. Consistency matters more than length. Include program name, business function, primary input and output files, schedule frequency, maintainer contact or team mailbox, and last significant change ticket. When an on-call engineer opens the member during an abend, the header answers whether this job feeds the general ledger or only a departmental preview.
123456789* ============================================================= * PROGRAM : PAYRPT01 * PURPOSE : Weekly payroll exception listing by cost center * INPUT : PAYROLL.PERSNL.WEEKLY (+1 GDG) * OUTPUT : PRT.PAYROLL.EXCEP(+1), SYSOUT control totals * SCHED : Sunday 02:00 after PAYEXT completes * OWNER : Payroll apps team / ticket queue PAY-APP * HISTORY : 2026-04-01 CHG12345 added local tax field LOC-TAX * =============================================================
Maintainability overlaps modular design: PERFORM named procedures, group FILE and macro invocations at the top, separate JOB logic from REPORT activities visually with comment banners. Use formatting standards from your site—consistent indentation and column alignment so diffs in Endevor show logic changes instead of whitespace noise. Avoid clever GOTO chains; explicit PERFORM and labeled exit paths age better. Keep working storage in Library with meaningful field names (TOT-GROSS-PAY not T17). Future you will thank present you.
Shared macros are maintainability assets when governed: one owner team, semantic versioning or parallel macro names for breaking changes, regression compile list attached to promotions. Breaking a positional parameter without updating callers silently shifts field offsets—a maintainability disaster discovered at month-end reconcile. Document parameter meaning in the macro prototype comment. When a layout change affects forty programs, the macro diff is one review; forty copy-paste edits are forty chances to miss column 47.
Maintainable code includes known-good test cases: small input files, expected totals, edge cases documented in the ticket or README. Store them in a team dataset or test repo referenced from the header. Before promoting changes, rerun those cases and compare SYSPRINT control totals or report extracts. Tests need not be automated on day one—but without them, maintainability is theoretical. After macro library updates, regression-compile at least one program from each business area that invokes the macro.
Operations staff maintain batch windows; developers maintain code. Maintainability includes the bridge between them. When runbooks lie—job renamed but wiki not updated—trust erodes and hot fixes skip process.
Large maintainability refactors (splitting god PROC, introducing macros) should behave identically before and after. Refactor in dedicated change tickets, not bundled with new business rules. Compare outputs byte-for-byte or total-for-total on test data. Use version control history to bisect when regressions appear. Teaching moment for beginners: cosmetic reformat-only commits help future diffs but still need compile verification.
When syntax deprecates across Easytrieve releases, maintainable programs carry migration comments: which release removes the old form, which replacement to use, and whether compatibility macros exist. Link to site migration pages and reserved word changes. Teams that ignore deprecation accumulate compile surprises during forced upgrades.
Maintainability is writing a recipe so someone else can bake the cake when you are not in the kitchen. You label the jars (field names), write how much sugar means what (business rules in comments), and keep one master list of ingredients (macros) instead of scribbling on fifty sticky notes. You also leave a note that says who to call if the oven smokes (operations runbook). If you only keep the recipe in your head, nobody can fix dinner when you are sick.
1. Maintainability primarily helps teams:
2. After editing a shared macro used by many programs you should:
3. Program header comments should include:
4. Copy-paste FILE layouts across programs hurts maintainability because:
5. Thin JOB INPUT with PERFORM improves maintainability by: