Skip to content

Dataset

COBOL and legacy code datasets for AI training

A COBOL dataset is a body of private production code written in COBOL, delivered with the copybooks, JCL, data definitions and change history that make the programs readable, and often requested alongside other under-represented languages such as RPG, PL/I, Fortran, ABAP, MUMPS, Ada, Delphi and PL/SQL. SourceX sources this code to a buyer's spec from established businesses that run or have retired such systems, and checks that the partner owns what it licenses. Each dataset is de-identified and licensed for an agreed permitted use.

Dataset manifest

Sourced to your spec
What it is
Private production code in under-represented languages, with copybooks, job control, data definitions and change history
Typical systems
IBM z/OS and IBM i source libraries, Endevor, ChangeMan ZMF, SAP transports, Subversion, CVS, git
Typical history
Specified by the buyer; many shops kept promoted versions and in-source change logs, not every edit
Modality
Source members as text, with a structured inventory, cross-reference and change records
Delivery formats
Agreed per order; UTF-8 text with original code page and column layout recorded, plus JSONL inventory
Preparation
Hard-coded credentials, dataset names, programmer IDs and customer data in test files removed or replaced
Licensing
Partner-written code only; vendor packages, licensed copybooks and generated code excluded or flagged
Availability
Sourced to your spec by language and platform; rare dialects may not be found; not guaranteed
CodeIllustrative

What a delivery contains

Fields vary by source system and are fixed per order. A typical delivery includes:

FieldTypeWhat it holds
member_idstringPseudonymous ID for one source member, stable across the inventory, cross-reference and change records.
member_typeenumProgram, copybook or include, JCL job, cataloged procedure, screen map, DCLGEN, control card or DDL.
languageobjectLanguage, dialect and compiler level, plus embedded sublanguages such as EXEC SQL or EXEC CICS.
source_formatobjectOriginal code page, record length, fixed or free layout, and whether sequence columns were kept.
applicationobjectThe application the member belongs to, batch or online mode, and a one-line functional summary.
dependenciesarrayCOPY and INCLUDE members and static or dynamic CALL targets, each marked resolved or missing.
data_accessarrayFiles, tables and segments the program reads or writes, with DD name, organization and access mode.
job_contextarrayThe jobs and steps that run the program, with predecessor jobs and restart behavior.
data_definitionsarrayRecord layouts, DCLGENs, DDL, IDCAMS definitions or DDS that describe the data the member touches.
change_historyarrayVersions with date, pseudonymous programmer, lifecycle stage, change ticket and a short note.
change_ticketobjectThe linked request: its type, such as regulatory, defect or enhancement, and the members it affected.
test_assetsobjectTest JCL, input layouts and expected outputs, with data marked synthetic or masked.
third_partyarrayVendor, licensed or tool-generated code detected in or called by the member, and the action taken.
completenessobjectWhether the member compiles with the delivered members and compile options, and what is missing.
Sample recordIllustrative

Field names from the table above; values are masked placeholders.

Example record

{
  "member_id": "mbr_4f20c",
  "member_type": "program",
  "name": "PAY4120",
  "language": { "name": "COBOL", "dialect": "Enterprise COBOL for z/OS", "compiler_level": "6.3",
                "embedded": ["EXEC SQL"] },
  "source_format": { "original_code_page": "IBM-037", "delivered_encoding": "UTF-8", "record_length": 80,
                     "layout": "fixed", "sequence_columns": "kept_1_6_and_73_80", "lines": 2874 },
  "application": { "id": "app_payroll", "mode": "batch",
                   "summary": "Calculates biweekly gross-to-net pay and writes the payment register" },
  "dependencies": [
    { "kind": "copybook", "target": "PAYEMPR", "resolved": true },
    { "kind": "copybook", "target": "PAYTAXTB", "replacing": "==:PFX:== BY ==TX==", "resolved": true },
    { "kind": "sql_include", "target": "DCLEMP", "resolved": true },
    { "kind": "static_call", "target": "DATECNV", "resolved": true },
    { "kind": "dynamic_call", "via": "WS-TAX-MODULE", "resolved": "partial" }
  ],
  "data_access": [
    { "kind": "db2_table", "name": "[SCHEMA].EMPLOYEE", "mode": "read" },
    { "kind": "vsam_ksds", "dd": "TAXTBL", "mode": "read" },
    { "kind": "sequential", "dd": "PAYREG", "mode": "write", "recfm": "FB", "lrecl": 400 }
  ],
  "job_context": [
    { "job": "PAYB0200", "step": "STEP030", "exec": "IKJEFT01 running PAY4120 under DSN",
      "predecessor": "PAYB0100", "restart": "step_level" }
  ],
  "data_definitions": ["copy/PAYEMPR.cpy", "dclgen/DCLEMP.cpy", "ddl/EMPLOYEE.sql", "idcams/TAXTBL.define"],
  "change_history": [
    { "version": "01.14", "date": "2009-11-03", "programmer": "pgmr_031", "stage": "PROD",
      "ticket": "chg_10482", "note": "State reciprocity rules added in 4200-CALC-STATE" },
    { "version": "01.22", "date": "2021-12-14", "programmer": "pgmr_007", "stage": "PROD",
      "ticket": "chg_31877", "note": "Year-end limit table widened, OCCURS 50 to 75" }
  ],
  "change_ticket": { "id": "chg_31877", "type": "regulatory",
                     "affected_members": ["PAY4120", "PAYTAXTB", "PAYB0200"] },
  "test_assets": { "test_jcl": "PAYT0200", "input_layout": "PAYEMPR", "expected_output": "compare_file",
                   "data": "synthetic_same_layout" },
  "third_party": [],
  "completeness": { "compiles_with_delivered_members": true, "compile_options": "TRUNC(BIN) ARITH(EXTEND) NUMPROC(NOPFD)",
                    "missing": [] }
}

Synthetic record for illustration. Field names, structure and format are agreed per order.

What AI teams use it for

Train models to read production legacy code

Programs delivered with copybooks and job control let a model explain what a field means, where a file comes from and what a paragraph does.

Check a modernization against both implementations

Pair the original module and its copybooks with the migrated version, build settings and permitted test fixtures. Run the same input through both and compare the business result, including rounding and exception handling. Ask which parts were independently rewritten or machine-translated and which cases have no expected output.

Learn maintenance from change records

Versions tied to change tickets, such as a regulatory update or a field expansion, become maintenance tasks with a stated reason and a known diff.

Evaluate on code that was never public

Private mainframe and midrange code makes test items for comprehension and impact analysis that a model cannot have memorized from public sources.

Build impact-analysis tools

A cross-reference of programs, copybooks, files and jobs gives ground truth for questions such as which jobs break if a copybook field is widened.

Use-case guides: Coding agents, Private evaluation sets, Enterprise and computer-use agents

What makes this data valuable

Copybooks resolve

Every COPY and INCLUDE target named in a program is in the delivery, including nested copies.

Job control included

JCL, procedures and scheduler definitions show how programs run and against which files.

Data definitions included

DDL, DCLGENs, VSAM definitions and record layouts describe the data each program reads and writes.

Changes tied to tickets

Each promoted version carries a ticket and a reason, not only a date and a programmer ID.

Original layout preserved

Column positions, sequence areas and the source code page are recorded, so fixed-format source still parses.

Source counts a reviewer can reproduce

Request a manifest keyed by application and program purpose. Report physical source lines by program and language, state how blanks and comments count, count each shared copybook once and exclude generated listings. Trace one job step to its program and file layout so a reviewer can reproduce the totals and see what the application does.

Countries and languages

COBOL dataset

This page covers legacy and rare-language codebases.Illustrative

Why public code under-represents these languages

Public code under-represents these languages because the systems written in them were never meant to leave the building. COBOL, PL/I, RPG and JCL were written inside banks, insurers, government agencies and manufacturers to run their own operations. The source lives in partitioned datasets on z/OS and source physical files on IBM i, managed by tools such as Endevor or ChangeMan, not on a code hosting site. Custom ABAP sits inside each company's SAP system as Z programs. What reaches the public web is mostly textbook exercises, course assignments, compiler test suites and small utilities.

A model trained on that material learns a toy version of the language. It expects a few hundred lines with one file and the record layout written inline. Production programs run to thousands of lines, take their layouts from copybooks through COPY REPLACING, mix EXEC SQL and EXEC CICS into the procedure division, and carry decades of change markers in columns 73 to 80. On modernization tasks the gaps show up as specific errors. The model invents fields it never saw defined. It mishandles COMP-3 packed decimals and the implied decimal point in a picture such as S9(7)V99. It misses REDEFINES overlays and PERFORM THRU fall-through, and it sorts as if the data were ASCII when the original ran on EBCDIC.

Private production code changes what the model sees: real program sizes, several generations of style in one file, site-specific macros and dialect details such as fixed-form RPG with indicators. That is also how this differs from a general proprietary codebase. The selection is by language and platform, and the unit is a set of members that resolve against each other, not a git repository.

What must come with the source

A legacy program is not usable without the members it depends on. A COBOL data division is often mostly COPY statements, so without the copybooks the record layouts are unknown and the program will not compile. The same holds for DCLGEN members for DB2 tables, BMS maps for CICS screens and DDS for IBM i files. The first test of any sample is whether every COPY, INCLUDE and static CALL target is in the delivery.

Job control explains what the program does in operation. JCL binds each DD name to a dataset, sets the step order and condition codes, and holds sort control cards that often contain business rules of their own. DB2 DDL and VSAM definitions written for IDCAMS give keys, record lengths and indexes. Build and deploy scripts matter more than they look, because compiler options such as TRUNC, ARITH and NUMPROC change arithmetic results.

Two more things make the code testable and its changes explainable. Production data will not come with the source, but record layouts with synthetic records in the same shape let you run a program under an emulator and compare a translated version's output byte for byte. Change tickets tie each version to its reason, such as a regulatory change, a field expansion or a production abend. Mainframe change managers often keep promoted package levels and in-source change logs, not one commit per edit, so ask what exists.

What to check before licensing

  • Resolve dependencies on the sample: list every COPY, INCLUDE and CALL target that is not in the delivery, and ask which of the missing members are vendor-owned.
  • Ask who wrote each layer. Legacy estates mix in-house programs with vendor packages, customized vendor source and outsourcer code, and the partner's rights differ for each.
  • Check the encoding conversion. Note the EBCDIC code page, look for mis-mapped characters such as the not sign, brackets and the vertical bar, and confirm how columns 1 to 6 and 73 to 80 were handled.
  • Confirm the compiler, dialect and compile options per program, and whether the sample compiles with the delivered members on the compiler or emulator you plan to use.
  • Search source, JCL and in-stream data for hard-coded user IDs, passwords, hostnames and customer records left in test files.
  • Ask what change history exists and where it comes from: change-manager package levels, in-source change logs or tickets.
  • Ask for generated code and near-duplicate programs to be flagged. Output from 4GL and CASE tools and copy-and-modify clones inflate line counts.

Delivery No files move before a signed license. A listing or a request grants no files by itself.

How licensing works through SourceX

  1. 1

    Define

    Send the domain, modality, volume, format, timeline and permitted use you need.

  2. 2

    Source

    SourceX identifies businesses that hold matching data and are open to licensing it.

  3. 3

    Qualify

    Fit, rights and quality are checked, and you review samples before committing.

  4. 4

    License

    Scope, permitted use, exclusivity, price and obligations are agreed in writing.

  5. 5

    Deliver

    Approved data is prepared, de-identified where required and transferred securely.

Questions Acquisition Partners ask

How is this different from a general proprietary code dataset?

It is selected by language and platform, not by repository. A proprietary codebase dataset delivers whole git repositories in whatever languages a company uses. This dataset targets code that public sources barely contain, such as COBOL, RPG, PL/I, JCL, ABAP and MUMPS, and it is judged on whether copybooks, job control and data definitions come with the programs.

Which languages and platforms can I request?

Any that a partner still holds and can license. Requests commonly name COBOL, RPG, PL/I, JCL, Fortran, ABAP, MUMPS, Ada, Delphi or PL/SQL. Specify the dialect and platform as well, for example Enterprise COBOL on z/OS with CICS and DB2, or ILE RPG on IBM i, because code for one compiler often will not build on another. Rare dialects are harder to find, and supply is not guaranteed.

Does the code come with version history?

Often, but rarely as git history. Mainframe and midrange shops track changes through tools such as Endevor or ChangeMan, and SAP tracks them through transports. These record versions promoted between stages, with a programmer ID, a date and a change ticket, not every edit. Many programs also carry a change log in their header comments. Where a team has moved its source into git, commit history starts at the migration date.

Can I compile and run the code?

Sometimes, with your own toolchain. You need a compiler or emulator for the dialect, and programs that call CICS, IMS or DB2 need those services or stand-ins for them. Vendor routines the partner cannot share will be missing and are listed in the manifest. State in your request whether compiling is required or only preferred.

Is production data included with the code?

No, not as part of a code dataset. What can come with the source is the shape of the data: record layouts, table definitions and synthetic or masked test records that follow them. Test libraries need checking, since teams often copied production files into test and left customer records there. Operational data from the same systems is a separate request with its own rights review.

Can I get legacy code paired with its modernized replacement?

Only where a partner has migrated a system and still holds both sides. Some companies have rewritten a subsystem from COBOL or RPG to Java or C# and kept the retired source, which gives before-and-after pairs at program or module level. The pairing is rarely line for line, because rewrites restructure the code and change the data model. Say in your request whether pairs are required.

Evaluating this data for procurement?

Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.

Request dataset diligence

Tell us what your models need

Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.

Updated 29 November 2026. Own data like this? See how companies license it to AI developers.

See if your company qualifies