Know a company with years of records? Refer it and earn up to $100K
Companies retiring a mainframe or legacy application

Mainframe Decommissioning: What to Do With the COBOL First

Mainframe decommissioning checklist for legacy system modernization: inventory, retention, archive formats, COBOL and JCL export, switch-off and AI value.

Short answerChecked

Mainframe decommissioning means retiring the system only after everything that must outlive it has been copied out in a form you can still read. Inventory the applications, data sets and code, check which records the law makes you keep, unload data to documented sequential files, export the COBOL, copybooks and JCL with their change history, then sanitize the storage. The code and its history may also interest AI companies before the switch-off.

Digital calipers on a quality inspection report on a factory workbench
Key points
  • Tax records on a mainframe must be kept, readable and "capable of being processed" for as long as they may be material, at minimum until the assessment period ends (IRS Rev. Proc. 98-25).
  • The IRS also expects record layouts, field definitions and data set names to be documented, which on a mainframe means keeping the copybooks.
  • IEBCOPY unloads code libraries to one sequential file, TSO TRANSMIT packages a data set for transfer, and Db2 UNLOAD writes table data to sequential files in external formats.
  • Code written by contractors is not automatically yours: a commissioned work is made for hire only under a signed written agreement, so check the maintenance contracts before you license or archive it.

What must outlive the mainframe after decommissioning?

Retention duties belong to the records, not to the machine. When the system goes, the obligation to produce its records stays, and the IRS is explicit that electronic records must remain usable. The table lists the rules we read that most often decide what a mainframe team keeps.

Rule or sourceWhat it saysWhat it means for the mainframeDate checked
IRS Rev. Proc. 98-25, section 5.01Machine-sensible records are kept "so long as their contents may become material"; at minimum until the assessment period ends, "including extensions"Accounting, billing and payroll data sets cannot be switched off with the system20 Nov 2026
Rev. Proc. 98-25, section 5.01(4)Records "must be capable of being processed"An unreadable tape or a file with no layout does not meet the rule20 Nov 2026
Rev. Proc. 98-25, section 6.03Keep "record formats or layouts", "field definitions" and "file descriptions (e.g., data set name)"Keep the copybooks and data set names next to every archived file20 Nov 2026
IRS, how long to keep recordsEmployment tax records for at least 4 years; some loss claims 7 yearsPayroll history has its own clock, often longer than the project plan20 Nov 2026
US Copyright Office, Circular 30A commissioned work is made for hire only with a signed written agreementCode from outside programmers may belong to them unless assigned in writing20 Nov 2026
NIST SP 800-88 Rev. 2Sanitization makes access to the data "infeasible for a given level of effort"Disks and tapes are sanitized only after the archive is verified20 Nov 2026

Sources: Rev. Proc. 98-25, IRS guidance on how long to keep records, Circular 30 and NIST SP 800-88 Rev. 2, read on 20 November 2026. Industry rules (banking, insurance, health care) can add longer periods. This page is general information, not legal advice.

Mainframe decommissioning vs legacy system modernization vs migration: what is the difference?

Legacy system modernization is the umbrella term. Mainframe modernization changes how an application is built or run, for example converting COBOL to another language or re-architecting it as services. Mainframe migration moves the workload to other hardware or to the cloud, sometimes with the code nearly unchanged. Mainframe decommissioning is the end state for whatever is left: the old system, or an application on it, is switched off for good.

Cloud migration guides put this in one list. AWS Prescriptive Guidance says there are "seven migration strategies for moving applications to the cloud, known as the 7 Rs": retire, retain, rehost, relocate, repurchase, replatform, and refactor or re-architect. Retire "is the migration strategy for the applications that you want to decommission or archive." The same guide warns that refactor "is not recommended for large migrations because it involves modernizing the application during the migration".

So most programs end with application decommissioning, also called legacy application retirement, even when the headline project is a migration. Once the new system runs, the mainframe still holds old history, retired programs and the source of record, and that is what this checklist is for.

Source: AWS Prescriptive Guidance, about the migration strategies (listed under Sources), read on 20 November 2026.

Mainframe decommissioning checklist: from inventory to switch-off

The order matters more than the tools. Each step below produces something the next step needs, and skipping one usually shows up months later as a record nobody can open.

  • Inventory every application: the CICS transactions, batch job streams, Db2 databases, VSAM files and sequential data sets it owns, and who still uses each.
  • Map dependencies: interfaces in and out, scheduled jobs, reports other teams receive, and any partner that still sends or reads files.
  • Set retention per record set: tax, payroll, customer and industry rules, plus legal holds. Write down the end date for each.
  • Decide the destination for each set: migrated to the new system, archived read-only, licensed, or deleted at the end of its period.
  • Export the code: every COBOL, PL/I, Assembler, Fortran and JCL library, the copybooks, the PROCs, the scheduler definitions and the change history.
  • Unload the data to documented sequential files, with the copybook or table definition beside each one and row counts recorded.
  • Reconcile: totals in the archive must match the books, the returns and the last production reports.
  • Test the archive: restore a sample on another system and read it without the mainframe.
  • Check contracts: software licenses, outsourcing and maintenance agreements, code ownership and any notice periods for termination.
  • Switch off, then sanitize the disks and tapes and record what was destroyed, by whom and when.

What should you keep: COBOL, copybooks, JCL and change history?

Keep the code even when nothing will run it again. It is the only exact description of how the old system calculated what the archive shows. A short worked example of how a program, its copybook and its JCL fit together is in COBOL code example with a copybook and JCL; this section covers what to take off the machine.

WhatWhere it usually livesHow to take it offWhy keep it
COBOL and other sourcePartitioned data sets (PDS or PDSE), or a source control libraryIEBCOPY unload of each library, or the library tool's own exportExplains every calculation behind the archived data
CopybooksTheir own libraries, shared by many programsSame unload; keep every version still referencedRecord layouts the IRS expects you to document
JCL, PROCs and schedulesJCL libraries and the job scheduler's databaseUnload the libraries; export the schedule definitionsShow which program read and wrote which data set, and when
Change historyThe change management tool or source controlExport versions with dates, authors and change ticketsShows why the code changed; links code to business events
Test data and resultsTest data sets and job outputUnload with the copybooks that describe themLets a later team check a conversion against known answers

IBM describes IEBCOPY's unload as copying "a partitioned data set into a unique sequential format known as an unloaded partitioned data set", which can then go to tape or be sent by FTP. For single data sets, TSO TRANSMIT "converts this data into a special format so that it can be transmitted to other users in the network". Sources: IBM's IEBCOPY utility page and TRANSMIT command reference, read on 20 November 2026.

How do you archive mainframe data in a read-only archive?

Unload to plain files, document them, and store them where a future auditor can read them without the mainframe. For Db2 tables, IBM's UNLOAD utility "copies data from one or more source objects to one or more BSAM sequential data sets in external formats". IBM is clear about the difference from a backup: the unload copy "includes the data only", without the system and header pages that an image copy keeps. That is what you want in an archive, because an image copy needs Db2 to read it.

The IRS accepts this approach. Rev. Proc. 98-25 lets a business that uses a database satisfy the rule by "creating and retaining a sequential file that contains the transaction-level detail from the DBMS", as long as the process that created it is documented. For VSAM and other files, unload to sequential records the same way.

Then make the files readable on other systems. Mainframe text is EBCDIC and many numeric fields are binary or packed, so record the code page and keep the copybook that defines each field. Convert a copy to a common format such as delimited text for daily use, keep the original unloads as the record of authority, and checksum both. Index the archive by data set name, period and owner, and set a review date to read a sample each year, as the NARA standard cited in Rev. Proc. 98-25 does for tape libraries.

Sources: IBM's Db2 13 UNLOAD utility page and Rev. Proc. 98-25, read on 20 November 2026.

When is it safe to switch off the mainframe?

When four things are true: the new system has run in parallel long enough to cover a full business cycle, including a year end; the archive reconciles to the books and returns; a sample has been restored and read elsewhere; and every owner of a record set has signed off on its destination and retention date.

Then switch off in stages. Stop batch jobs and online access, keep the system dormant for an agreed period with a restore path, and only then end the contracts and sanitize the media. NIST's media sanitization guidance exists for this last step: it helps organizations choose "proper and applicable techniques and controls for sanitization and disposal based on the sensitivity of their information". Record the method used for each device. If a retained record was on a device you destroyed before archiving, there is no second chance.

Who owns the COBOL if contractors wrote it?

Code your own employees wrote as part of their jobs is normally the company's. Code from outside programmers and outsourcing firms is different. The Copyright Office explains that a commissioned work counts as made for hire only when it falls in one of nine listed categories and "There must be a written agreement" signed by both sides; "If a work fails to satisfy any of these requirements, it is not a work made for hire." Ownership then turns on whether the contract assigned the code to you.

Before archiving, licensing or handing the code to a successor vendor, pull the development, outsourcing and maintenance agreements and check three clauses: who owns code delivered under it, what confidentiality limits apply to the vendor's own tools or libraries mixed into yours, and what must be returned or destroyed when the contract ends. If a business unit or product line is being retired with the system, records of a dormant subsidiary or retired product covers who owns them afterwards.

What is old COBOL worth to AI companies before you retire it?

Often more than the decommissioning budget assumes. AI companies building code models need real enterprise COBOL, JCL and copybooks with their history, and very little of it is public. GAO's 2025 review of the most critical federal legacy systems found that "Eight of the 11 systems use outdated languages", and that two Treasury systems still run COBOL and Assembler. The same scarcity of people who know these languages is what makes well-documented code useful for training.

What adds value: complete libraries rather than samples, change history that shows how programs evolved, the tickets and specifications behind changes (see export Jira data and Confluence spaces if they live there), and test data with known results. What blocks a deal: unclear ownership of contractor code, embedded customer data, and credentials left in JCL or code, which should be removed first, as remove secrets from git history explains.

AI companies pay $20K to $5M for company records. Where a mainframe codebase lands depends on size, history, documentation and rights. What COBOL and mainframe shops can license, and what buyers check, is in license your legacy COBOL and mainframe code to AI. We help you license your data. Origin Data Partners is an independent data partner that helps business owners value and license their company records: the company pays Origin nothing, and a buyer may pay Origin when a deal completes.

Do this before the switch-off, while the libraries and change history are easy to export. Check what the code may be worth; the check starts from a description, not from your files. Not the owner? Advisers can introduce the company.

Source: GAO-25-107795, read on 20 November 2026.

How we checked this

We read every source on this page on 20 November 2026. Retention rules come from primary tax guidance: IRS Rev. Proc. 98-25 and the IRS page on how long to keep records. Code ownership comes from the US Copyright Office's Circular 30. Export and archive methods come from IBM's own documentation for IEBCOPY, TSO TRANSMIT and Db2 UNLOAD. Media sanitization comes from NIST SP 800-88 Rev. 2, migration strategies from AWS Prescriptive Guidance, and the state of federal legacy systems from GAO.

What we could not verify: IBM's and GAO's pages refuse scripted reads, so we read them through a search service and saved the text. We did not verify retention periods for specific industries, which vary by regulator and state, and no buyer has published a price for COBOL codebases.

Common questions

How to modernize legacy systems?

Start with an inventory and a decision per application: retire it, keep it, move it as it is, move it to a new platform, replace it with a product, or rebuild it. Rebuilding during a large migration is the riskiest choice. Run old and new in parallel through a year end, reconcile the results, archive what the law requires, and decommission the old system last.

What does it mean to decommission an application?

It means switching the application off for good after its data, code and documentation have been dealt with. Data that must be kept moves to a read-only archive or a new system, interfaces are closed, licenses and contracts end, and the storage is sanitized. Decommissioning differs from migration: nothing replaces the old application one for one, though its records stay available.

What is a decommissioning process?

A set order of steps for retiring a system safely: inventory, dependency mapping, retention decisions, export of code and data, reconciliation, a restore test, contract review, switch-off and media sanitization. Each step produces evidence, such as row counts, sign-offs and destruction records, that auditors and later teams can rely on after the system and the people who knew it are gone.

What can replace a mainframe?

Usually a mix: commercial software for standard functions such as payroll or accounting, applications rehosted or replatformed on servers or in the cloud, and rebuilt services for the logic that makes the business different. Some companies keep a smaller mainframe for the core and move the rest. Whatever replaces it, the old records and code still need archiving before switch-off.

Can mainframe be migrated to cloud?

Yes, in several ways. Rehosting moves the applications without changing them. Replatforming moves them with some optimization, such as a new runtime or database, and refactoring converts the code to another language or architecture. Cloud providers' own guidance warns against refactoring during a large migration. Either way, keep the original source, copybooks and change history in the archive.

Does anyone still use mainframes?

Yes. Banks, insurers, retailers and government agencies still run core systems on them. In a 2025 review, GAO found that eight of the eleven most critical federal legacy systems use outdated languages, and that two Treasury systems still run COBOL and Assembler. The shrinking pool of people who know these languages is one of the main reasons companies decommission.

What are the 7 R's of mainframe modernization?

Retire, retain, rehost, relocate, repurchase, replatform, and refactor or re-architect. AWS Prescriptive Guidance lists these as the seven migration strategies. Retire is the one for applications you want to decommission or archive; retain keeps them where they are for now. For a mainframe, the choice is usually made application by application rather than for the whole machine.

We're migrating off our mainframe. Is our old COBOL codebase worth anything before we retire it?

It can be. AI companies training code models want real enterprise COBOL, JCL and copybooks, especially with change history and test data, and little of it is public. Value depends on size, history, documentation and clear ownership, so check contractor agreements first and remove credentials and customer data. Export it before the switch-off, while the libraries are still easy to reach.

Sources and further reading

What is your company’s data worth?

AI companies pay $20K to $5M for company records. Six questions, no files.