Can COBOL and other mainframe code be licensed to AI companies?
Often, if the company wrote it and still holds the source. Banks, insurers, utilities, payroll bureaus and government contractors run programs written decades ago in COBOL, PL/I, RPG and assembler. Very little of that code is public, so models trained on public repositories write it badly. A company that can show the programs, the job control that runs them and the notes explaining what each one does holds something that is hard to find anywhere else.
What a mainframe or midrange shop usually has
| Program source | COBOL, PL/I, RPG or assembler members pulled from the source libraries, often thousands of programs written by people who retired long ago. |
| Copybooks and record layouts | The shared definitions of every file and record the programs read. Without them a COBOL program cannot be understood or compiled. |
| JCL, CL and batch schedules | The job control that strings programs into a nightly run: which step reads which file, what happens on a failure, what runs after month end. |
| Change history and change tickets | Version records from the library manager and the tickets behind each change. A ticket that says why a field grew from five digits to seven explains the code better than a comment. |
| Migration and modernization work | Specifications, mapping sheets and rewritten Java or C# versions of old programs, where the company has moved part of the system already. The pair of old and new is rare. |
Why old code is scarce training material
Public code hosts hold a great deal of Python and JavaScript and very little production COBOL. The programs that settle payments or rate insurance policies were never published, because they were the business. A model asked to explain or convert such a program has seen few real examples, and it shows.
The most useful sets connect the parts. A program on its own is a puzzle. The same program with its copybooks, the JCL that runs it, the ticket history and a plain description of what it does lets a reader follow the logic from input file to report.
Who wrote the code and who owns it
Mainframe estates were often built by outside firms. Code written under an outsourcing or staffing contract may belong to the company, to the contractor or to both, depending on the assignment clause. Your counsel reads those contracts before any program is listed.
Licensed packages are a separate problem. A banking or payroll package from a software vendor sits in the same libraries as in-house code, and the vendor owns it. Those members, and any in-house changes made on top of them, come out of the set unless the vendor agrees.
Read next: Code and pull request history, Is it legal to sell company data?.
How buyers price mainframe code
Buyers usually count in programs or in thousands of lines of source, and some count whole applications. The count alone rarely sets the figure. Documentation, change tickets, test cases and old and new pairs from a migration raise what each program is worth, and so does a language with few public examples. The amount and payment terms are settled for each deal.
Read next: How much company data is worth, How you get paid.
Preparing the source for a first review
Start with an inventory: application names, language, member counts and line counts per library, and the years each was active. Most library managers produce that report without anyone opening a program.
Before any sample leaves, search the source for passwords, dataset names that reveal customers, hard-coded account or policy numbers and test files built from real customer records. Test data is the usual leak. Copies of production files used for testing are replaced or left out.
What stays out of a mainframe code set
| Vendor packages and their modifications | Code the company licensed from a software vendor, and in-house patches applied to it, stay out unless the vendor agrees in writing. |
| Production data in test libraries | Files copied from live systems for testing often hold real names, accounts and balances. They are removed, not cleaned. |
| Credentials and security exits | Passwords, keys and security-related exits and configuration are removed before the source is sampled. |
| Code written for a client under contract | A service bureau that ran programs written for a client keeps those programs out unless the client contract allows reuse. |
More on this: how personal details are removed, who carries the risk and how you get paid.
An example, invented for illustration
A regional insurer runs policy rating and billing on a mainframe, about four thousand COBOL programs with copybooks and JCL, plus fifteen years of change tickets. Two years ago it rewrote the billing system in Java and kept the mapping sheets. The licensable set is the rating and billing source, the copybooks, the tickets and the old and new billing pair. The vendor general ledger package and the test libraries holding copied policy files are left out.
Questions owners ask about this
We still run this code. Does licensing it put us at risk?
The code is copied, not handed over, so the system keeps running as before. The security question is whether the source reveals anything an attacker could use, which is why credentials, network names and security exits are removed and your security team reviews the sample.
Does the code need comments to be worth anything?
Comments help, but many old programs have almost none. Change tickets, run books and a short written description of what each application does can do the same job, and they are often easier to produce.
Can we include the modernized version we paid a contractor to build?
Only if the contract assigns that code to you. Modernization projects often leave the converter or framework with the contractor while the converted programs belong to the client, so counsel checks which parts you own.
Didn't find your question? Ask us directly.
Keep reading
Related kinds of records
- SOPs and knowledge bases: Procedures with their edit history and comments; published help articles add nothing.
- Code and pull request history: The commit, the review and the failed fix before the working one, with secrets and borrowed code removed.
Industries that keep these records
- IT services and MSPs: Tickets, runbooks and alert-to-fix histories; client secrets and client contracts set the limits.