Skip to content

Dataset

IBM z/OS mainframe datasets for AI training

An IBM mainframe dataset is an extract of the records a business keeps on IBM z/OS: Db2 for z/OS tables, VSAM and sequential data sets and IMS segments, decoded from EBCDIC and packed decimal into open formats, together with the COBOL copybooks that define each record layout and the JCL that ran the batch work. SourceX sources it to a buyer's spec from established businesses that run z/OS for their core transaction processing. Each dataset is de-identified and licensed for an agreed permitted use.

Dataset manifest

Sourced to your spec
What it is
Chosen Db2 tables, VSAM and sequential data sets and IMS segments, decoded, with their copybooks and JCL
Typical systems
IBM z/OS with Db2 for z/OS, IMS, VSAM, CICS and batch COBOL; SMF records and source libraries held in Endevor or ChangeMan ZMF where in scope
Typical history
Current master files plus the generations, image copies and tape archives the owner kept; depth differs per data set, so specify it
Modality
Fixed and variable-length records as structured rows; copybooks, JCL and Db2 DDL as source text
Delivery formats
Parquet or JSONL per record type with exact decimal types, raw binary files on request, copybooks and JCL as text, Db2 catalog extracts
Preparation
Account, card, policy and tax identifiers removed or replaced with stable pseudonyms; free-text areas reviewed; undecodable fields flagged, not dropped
Licensing
Scoped per table, data set and generation; permitted use agreed per license; program source and package layouts in scope only where the owner holds the rights
Availability
Sourced to your spec; depends on the generations and copybook versions the owner still holds, and supply is not guaranteed
Structured recordsIllustrative

What a delivery contains

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

FieldTypeWhat it holds
source_dsnstringThe z/OS data set name the record was read from, with its generation number when it belongs to a generation data group.
dataset_attributesobjectDSORG, RECFM and LRECL, the EBCDIC code page the owner states and, for VSAM, the cluster type (KSDS, ESDS or RRDS) from an IDCAMS LISTCAT.
copybook_memberobjectThe partitioned data set member holding the COBOL copybook used to decode the record, with its version from the source library.
record_typeobjectThe 01-level layout or REDEFINES branch applied to the record, and the discriminator field value that selected it.
record_keystringThe KSDS key or Db2 primary key, pseudonymized the same way everywhere so related data sets still join.
decodedobjectThe copybook's elementary items under their COBOL data names, with OCCURS tables as arrays cut to their DEPENDING ON count.
picture_clausesobjectThe PICTURE and USAGE of items as the copybook declares them, so sign, scale and storage form can be checked.
condition_namesobjectThe 88-level condition names under coded fields, giving each code value the meaning the copybook states.
decode_flagsarrayFields whose bytes were not valid for the declared type, such as spaces in a COMP-3 field, kept with their raw hex.
database_objectobjectFor Db2 for z/OS rows, the table and its column types from SYSIBM.SYSCOLUMNS; for IMS, the segment and its parent from the database description (DBD).
writing_jobobjectThe job, step and program that wrote the data set, read from the delivered JCL.
Sample recordIllustrative

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

Example record

{
  "source_dsn": "PRODA.LN.MASTER.BKUP.G0412V00",
  "dataset_attributes": {
    "dsorg": "PS",
    "recfm": "VB",
    "lrecl": 404,
    "unloaded_from": "VSAM KSDS",
    "ccsid": 37
  },
  "copybook_member": {"library": "PRODA.COPYLIB", "member": "LNMSTR01", "version": "pkg_000417"},
  "record_type": {"layout": "LN-PAYMENT-REC", "discriminator": "LN-REC-TYPE", "value": "20"},
  "record_key": "acct_7f3a91c2",
  "decoded": {
    "LN-ACCT-NO": "acct_7f3a91c2",
    "LN-REC-TYPE": "20",
    "LN-EFF-DATE": "2019-03-29",
    "LN-PMT-AMT": "1482.17",
    "LN-PRIN-AMT": "1103.52",
    "LN-INT-AMT": "378.65",
    "LN-PMT-SRC-CD": "A",
    "LN-FEE-CNT": 1,
    "LN-FEE-TBL": [{"LN-FEE-CD": "LT", "LN-FEE-AMT": "25.00"}],
    "LN-LAST-MAINT-DATE": null
  },
  "picture_clauses": {
    "LN-PMT-AMT": "PIC S9(9)V99 COMP-3",
    "LN-FEE-TBL": "OCCURS 0 TO 10 TIMES DEPENDING ON LN-FEE-CNT"
  },
  "condition_names": {"LN-PMT-SRC-CD": {"A": "PMT-SRC-AUTO-DEBIT", "B": "PMT-SRC-BRANCH"}},
  "decode_flags": [
    {
      "field": "LN-LAST-MAINT-DATE",
      "issue": "spaces_in_packed_field",
      "raw_hex": "40404040"
    }
  ],
  "database_object": null,
  "writing_job": {"job": "LNB0410D", "step": "STEP030", "program": "IDCAMS"}
}

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

What AI teams use it for

Train coding agents on mainframe modernization

Copybooks paired with raw bytes and the correct decoded rows make tasks in writing parsers and converting layouts to schemas.

Teach record layout and schema mapping

REDEFINES branches, variable tables and 88-level codes are mapping problems with a known answer in the decoded output.

Model account and policy state over time

Successive generations of a master file backup show the same accounts as dated snapshots.

Build data-quality checkers for legacy files

Invalid packed fields, sentinel dates and reused filler areas are labeled examples of what breaks a migration.

Evaluate migration and reconciliation agents

Trailer counts and control totals give a checkable target for an agent that converts a file.

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

What makes this data valuable

A copybook for each file and period

Each data set comes with the copybook version in force when it was written.

Raw binary kept beside the rows

The buyer can decode again and confirm the delivered values.

Discriminator rules written down

Each REDEFINES branch has a stated test, taken from the program that reads the file.

Several generations

More than one generation of the same file turns current state into history.

Totals that reconcile

Record counts and summed amounts match the trailer records.

JCL and catalog listings

They show which job wrote each data set and from which inputs.

Process

IBM mainframe dataset

This page covers IBM z/OS mainframe data sets.Illustrative

The record layout lives in the copybook, not in the file

A VSAM cluster or a sequential data set on z/OS is a run of bytes with a few catalog attributes: a record format, a record length and, for a key-sequenced cluster, where the key sits. It has no column names and no types. Those exist only in a COBOL copybook, a source member that programs pull in at compile time. The copybook says that PIC S9(9)V99 COMP-3 is six bytes of packed decimal with two decimal places that are implied and stored nowhere, and its 88-level condition names are often the only written statement of what a one-byte code means. Db2 for z/OS is the exception, since its catalog describes every column. In IMS the database description names each segment and its parent, and the fields inside are again laid out in a copybook.

Two clauses make these files harder than a table. REDEFINES lays a second layout over the same bytes, which is how one file comes to hold header, detail and trailer records. The copybook does not say which layout applies to which record. The program does, by testing a record-type field, so that rule has to come from the program source or the team that runs it. OCCURS DEPENDING ON repeats a table as many times as a count field earlier in the record says, so records vary in length and every field after the table moves. A parser that misreads one count misreads the rest of that record.

Online CICS transactions rewrite master records in place, so a master file is current state only, and what changed is in the batch files around it. Copybooks change too. Spare FILLER bytes become new fields over the years, and an old file decodes correctly only with the copybook as it stood then. A copybook library normally holds only the current copy of each member, so earlier versions survive only where a source manager such as Endevor or ChangeMan ZMF kept them.

Why a text-mode transfer corrupts packed and binary fields

z/OS stores characters in EBCDIC and many numbers in forms that are not characters at all. A COMP-3 field packs two digits into each byte and keeps the sign in the last half byte. A COMP field is a big-endian binary integer. A signed zoned decimal field carries its sign in the last digit, which then reads as a letter. A transfer in text mode translates every byte to ASCII as if it were a character, so packed and binary bytes come out as other values. Character text and unsigned zoned digits come through, and every other number can no longer be trusted. Files have to leave the mainframe in binary, and for variable-length data sets the transfer must keep the record descriptor word in front of each record, or the record boundaries are gone. Decoding then happens field by field: characters from the right EBCDIC code page, numbers to the scale the copybook gives.

IDCAMS REPRO copies a VSAM cluster to a sequential data set. The Db2 UNLOAD utility writes table rows to a data set and can generate a matching LOAD statement that describes the unloaded record, so ask for that statement with the file. IMS databases are unloaded as segments in hierarchical order. Generation data groups are where the history is: each run of a batch job writes a new numbered generation under one base name, and the oldest rolls off once the limit set on the base is reached. The generations of a nightly backup are a series of dated snapshots, and comparing two neighbors yields that day's changes.

To test a sample, ask for the raw binary of one file and decode it yourself against the delivered copybook. Sum a packed amount field and compare it with the control total in the trailer record, where the file has one. Count the fields flagged as invalid, typically spaces or low-values in a packed field no program initialized. Look for dates of all zeros or all nines, which are sentinels.

What to check before licensing

  • Have the data owner and your counsel check IBM's license terms for z/OS, Db2 and the utilities used, and the terms of any extraction tool, on exported data and API use.
  • Ask whether the application is a licensed package, such as a core banking system, because its copybooks and record layouts may belong to that vendor.
  • For every file, ask which copybook version was in force when it was written and how that was established, then decode the oldest generation in the sample with it.
  • Check with counsel that account, payment and policyholder data is de-identified to the standard your regulator expects, including identifiers packed into COMP-3 fields, keys and free-text remark areas.
  • Confirm the files left z/OS in binary with record descriptor words kept, and ask for one raw file to decode yourself.
  • For each REDEFINES, ask for the rule that picks the layout and the count of records per type, including records that matched none.
  • Ask which generations of each generation data group still exist, on disk or tape, and what dates they cover.

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

Do I need a mainframe to use the data?

No. A dataset decoded to open formats such as Parquet or JSONL reads on ordinary hardware, so specify exact decimal types for amounts and how packed dates are converted. Raw binary files, if you take them too, can be parsed on ordinary hardware with open-source copybook readers, provided they were transferred in binary and you hold the matching copybooks.

Why does every file need its COBOL copybook?

Because a VSAM or sequential data set carries no field names, types or lengths of its own. The copybook is the only description of where each field starts, whether a number is packed, binary or zoned, and where its decimal point is assumed. With the wrong version of it, fields shift and values decode to plausible nonsense.

How much history does a mainframe file hold?

It depends on the kind of file. A master file updated online holds current state only. History sits in the batch files around it: daily transaction files, backups and extracts kept as numbered generations, and older copies on tape. How many generations survive is set per file, so name the period you need and ask what exists.

Are Db2 for z/OS tables easier to work with than VSAM files?

Usually, yes. The Db2 catalog names every column with its type, length and nullability, so a table can be unloaded without a copybook. Two checks remain. Some designs store a whole COBOL group in one character column, which again needs a copybook, and code columns still need their lookup tables.

Can JCL, COBOL programs and SMF records be included?

JCL and copybooks normally travel with the data, since they explain layouts and lineage. COBOL program source is a separate scope and may belong to a software vendor, so its ownership is checked first. SMF records, which log job runs, data set activity and CICS and Db2 work, can be in scope too.

Is SourceX affiliated with IBM?

IBM z/OS is named to identify the system the records come from. That does not imply a partnership with or endorsement by IBM. The records belong to the business that runs IBM z/OS, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.

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 26 November 2026.

See if your company qualifies