Know a company with years of records? Refer it and earn up to $100K
COBOL, Fortran and JCL code

COBOL and Mainframe Shops: License Your Legacy Code to AI

Yes, if you own the code. Before COBOL modernization or retirement, how mainframe shops license COBOL, JCL, Fortran and copybooks with history to AI.

Short answerChecked

Yes, COBOL and mainframe shops can license legacy code to AI companies when they own it and can strip secrets and customer data. AI companies pay $20K to $5M for company records; no buyer has published a price for COBOL alone. In-house code written by employees usually belongs to the company. Code a firm wrote for clients usually belongs to the clients when the contract assigns it, which most outsourcing contracts do. Change history from Endevor, ChangeMan or git adds most of the value.

A server rack with blue patch cables and a laptop showing a ticket queue
Key points
  • Code your employees wrote on the job is a work made for hire owned by the company (17 U.S.C. 101 and 201(b)); code a contractor wrote needs a signed assignment.
  • Outsourcing and maintenance firms rarely own client code; the client decides, and the firm's contract usually adds confidentiality on top.
  • Research teams building COBOL models report that existing LLMs "struggle to generate and translate COBOL code correctly", which is why real production code is scarce and wanted.
  • Export the history before a migration: moving an Endevor element consolidates its levels, and they cannot be recovered.

Which rules decide whether COBOL and mainframe shops can license code?

Ownership comes from the copyright statute and your contracts; confidentiality comes from the contracts alone. The table quotes the rules that decide most cases. This page is general information, not legal advice.

Rule or sourceWhat it saysWhat it means for your codeDate checked
17 U.S.C. 101A "work made for hire" includes "a work prepared by an employee within the scope of his or her employment"Programs your staff wrote on the job are company works20 Nov 2026
17 U.S.C. 201(b)For a work made for hire, "the employer or other person for whom the work was prepared is considered the author"The company owns that code from the start20 Nov 2026
17 U.S.C. 201(a)Copyright "vests initially in the author or authors of the work"Code a contractor wrote belongs to the contractor unless rights were transferred20 Nov 2026
17 U.S.C. 204(a)A transfer of copyright "is not valid unless" it is "in writing and signed"Look for a signed assignment for every outside programmer20 Nov 2026
Copyright Office Circular 30A commissioned work is made for hire only if it meets "all of the following four criteria", including one of nine categoriesSoftware rarely fits those categories, so contractor code needs an assignment, not a work-for-hire label20 Nov 2026

Sources: 17 U.S.C. 101, 17 U.S.C. 201 and 204 and Circular 30, read on 20 November 2026 on the US Copyright Office's site.

Who owns the code: in-house teams, contractors or the firms that maintain it?

For an in-house mainframe team the answer is usually simple. The statute defines a computer program as "a set of statements or instructions to be used directly or indirectly in a computer in order to bring about a certain result", and programs employees wrote within their jobs belong to the employer. A bank, insurer, utility or manufacturer that built its own batch and online systems owns that code, with two gaps to check: contractors and vendor packages.

Contractors are common on mainframes, often for decades. Their code is theirs unless a signed agreement assigned it. Most staffing and consulting contracts include an assignment clause, but find the paper, especially for the oldest systems. Vendor packages, utilities and anything licensed from a software company are the vendor's and stay out, even if your staff modified them heavily.

Firms that maintain code for clients are in the opposite position. An outsourcing or application-maintenance firm usually works on code the client owns, under a contract with strict confidentiality. The firm cannot license that code. What it may own is its own tooling, conversion utilities, test harnesses and generic routines it wrote outside client work, if its contracts let it keep them.

What do AI companies want from COBOL, Fortran and JCL code?

They want real production code with its context, because public COBOL is scarce. A 2026 paper on COBOL-Coder found that "existing large language models (LLMs) struggle to generate and translate COBOL code correctly". The XMainframe team built "an extensive data collection pipeline to produce high-quality training datasets" to train a model for mainframe and COBOL codebases. Another 2026 paper notes "a declining pool of skilled developers", which matches what the US Government Accountability Office reports.

GAO found in 2025 that both of the Treasury Department's selected critical systems "run on Common Business Oriented Language (COBOL)", languages with "a dwindling number of people available with the skills needed to support them". AI companies building modernization and code assistants need examples of how such systems really work.

The most useful set is a complete application: COBOL programs with the copybooks they include, the JCL that runs them in batch, CICS transactions, DB2 SQL and VSAM layouts, Fortran or PL/I where it exists, test cases with expected output, and run books. Documentation and comments matter, as do the business rules they explain.

Why do change history and each copybook raise the value?

Change history shows how the code was maintained, which is the task AI models are being trained to help with. Each level records what a programmer changed, when, and often a change request or ticket number. Thirty years of levels on a claims system is a record of every rule change, defect fix and regulatory update the business made.

In Endevor, the PRINT ELEMENT statement's history option "Prints all lines that have ever been in the element or component list source, noting the level at which the line was added, changed, or deleted." The Zowe CLI exposes the same report: its print option lists "Allowed values: browse, changes, history, summary, master, listing". ChangeMan and other library managers keep similar records, and some shops already moved history into git.

A copybook is the shared record layout that many programs include, so a set with every copybook resolved lets a model see how data moves across programs. A program without its copybooks is half a program. The same goes for JCL: without the job streams, nobody can see how programs chain together in the nightly batch.

Link the history to its reasons where you can. A change level that carries a change request number becomes far more useful when the request itself, with its description and approval, sits alongside it. Many shops kept those requests in a separate ticket system or in spreadsheets; an export of them, matched to element names and dates, turns a list of code edits into a record of why the code changed. Fortran shops in engineering and science can do the same with their own version records and test decks.

When should you license code during COBOL modernization or retirement?

Before the migration tools touch it. Modernization projects convert, restructure or replace code, and the old history is often lost on the way. Broadcom's knowledge base gives a sharp example for Endevor: "Once the element is moved, the individual levels are consolidated into a single VVLL Delta. There is no way to get the individual levels back."

IBM's guide to moving mainframe source to git says "Legacy version control systems often store data in a proprietary format", so "the source code should first be unloaded to PDS libraries", and its DBB migration tool then copies "source code PDS members into a pre-existing local Git repository". That unload carries the current source; the level history needs its own export from the library manager, such as the Endevor history report. Run that export before the project starts.

The same applies when a system is switched off entirely. Retention duties may keep the data, but the code itself is often deleted once the new system is live. For the code and copybook structure itself, see Origin's COBOL, copybook and JCL example.

What must you strip from legacy code before licensing it?

Mainframe code carries things modern code keeps elsewhere. Strip them in this order before any sample leaves the company.

  • Credentials: user IDs and passwords in JCL, PROCs and parameter members, plus connection details for DB2 and MQ.
  • Customer data: test files copied from production, hard-coded account numbers and names, and sample records in comments.
  • Security details: RACF or ACF2 rules, dataset names that reveal network or security layout, and addresses of internal systems.
  • Third-party code: vendor packages, licensed utilities and anything a contractor wrote without an assignment.
  • Client code, for maintenance firms: everything you hold under a client contract. For tickets and specifications that explain the code, see Origin's guide to exporting Jira and Confluence data.

What should COBOL and mainframe shops do next?

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. Start with a description: languages, rough line counts, years of change history, which library manager holds it, and who wrote the code.

We work only with data you created in running your business, or hold under a written licence that lets you license it for AI training. We do not take scraped web data, purchased contact or consumer lists, people-search or location data, or personal data collected without a notice that covers this use. When you have that, check what your legacy code may be worth. Origin's guide on whether a company can sell its source code covers modern codebases. Not the owner? Advisers can introduce the company.

How we checked this

We read every source on this page on 20 November 2026. The ownership rules come from the copyright statute and Circular 30 on the US Copyright Office's official site. The export steps come from IBM's own Z DevOps guide, Broadcom's Endevor reference and knowledge base, and the Zowe project docs. The market context comes from a GAO report and three research papers on arXiv.

What we could not verify: the terms of any particular outsourcing or maintenance contract, which are not public; how ChangeMan exports history, because its documentation sits behind a login; and any price for a COBOL codebase, because no buyer has published one. The approved range above covers company records in general.

Common questions

Can a company sell or license its legacy COBOL code to AI companies? Who buys it and what does it pay?

Yes, if the company owns the code and strips secrets and customer data first. AI companies building code assistants and modernization tools want production COBOL, and AI companies pay $20K to $5M for company records in general. No buyer has published a price for COBOL specifically. Licensing keeps ownership with the company, so it can still run, migrate or retire the code.

We have 30 years of COBOL and JCL with change history. Do AI companies buy legacy code like that?

That is the kind of set they look for: complete applications with copybooks, JCL and decades of change levels. Public COBOL is scarce, and research teams report that general models still struggle with it. The history is the rare part, so export it from the library manager before any migration. Ownership checks on contractor code come first.

COBOL migration: should we export the old code and its change history before the mainframe is retired?

It can be, and the time to find out is before the migration starts. Conversion tools and library moves often discard level history, and a decommissioned system's code is usually deleted once the new one is live. Export the source, copybooks, JCL and the history reports first, keep them inside the company, and describe what you hold before deciding anything.

Can you sell COBOL code?

You can license COBOL code you own, which is how most companies would do it: the buyer gets defined rights to use the code for training, and you keep ownership. Code written for you by employees is usually yours; contractor code needs a signed assignment; vendor packages and client code are not yours to license. Remove credentials and customer data first.

Can AI be used to migrate legacy code?

Yes, AI tools are used to explain, document and translate legacy code, such as COBOL to Java, and research teams have built models just for COBOL and mainframe work. Results still need review and testing: a 2026 paper found existing models struggle to generate and translate COBOL correctly. That gap is why real production code with history is in demand.

What is COBOL being replaced with?

Most often Java or C#, sometimes running on cloud platforms, and sometimes a packaged system replaces the custom code entirely. Many companies instead keep COBOL on the mainframe and modernize around it, moving source into git and adding APIs. Whatever the route, the old code and its change history are usually archived or deleted at the end, so decide about them early.

Why do banks use COBOL?

Because their core systems were written in COBOL decades ago and still run reliably at high volume. Rewriting account, payment and ledger systems is expensive and risky, so many banks keep them and build newer services around them. The GAO reports that skilled COBOL staff are getting harder to find, which is one reason tools for understanding this code matter.

Who helps a company license its legacy mainframe code to AI companies?

Origin Data Partners helps companies license code and records they own. The company first describes what it holds without sending files: languages, line counts, years of history, the library manager and who wrote the code. The company decides and signs any license itself, and its own counsel reviews contractor assignments and client contracts before anything is shared.

Sources and further reading

What is your company’s data worth?

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