Copybooks parsed into typed schemas. COBOL programs converted to PySpark DataFrames. JCL job streams become Databricks Workflows. VSAM and flat files land as Delta Lake tables. Full lineage, validated parity.
Book a Live Demo →COBOL programs process records one at a time through PERFORM loops. PySpark on Databricks processes the same logic across a cluster of executors. Batch windows that run overnight can finish in minutes.
COBOL copybooks define record layouts with PIC clauses, REDEFINES, and OCCURS. MigryX parses these into PySpark StructType schemas with correct data types — including packed decimal (COMP-3) and zoned decimal handling.
JCL EXEC, DD, and PROC statements define job steps, datasets, and execution order. Databricks Workflows handle the same DAG orchestration with parameterized tasks, conditional branching, and failure alerting.
A COBOL copybook with REDEFINES and a batch program that reads VSAM, applies business rules, and writes output — converted to a PySpark job on Databricks with Delta Lake output.
COPY ACCT-REC.
05 ACCT-ID PIC X(10).
05 ACCT-BAL PIC S9(9)V99 COMP-3.
05 ACCT-TYPE PIC X(1).
88 SAVINGS VALUE 'S'.
88 CHECKING VALUE 'C'.
05 OPEN-DATE PIC 9(8).
PROCEDURE DIVISION.
PERFORM UNTIL END-OF-FILE
READ ACCT-FILE INTO ACCT-REC
IF ACCT-BAL > 100000
MOVE 'HIGH' TO RISK-FLAG
ELSE
MOVE 'STD' TO RISK-FLAG
END-IF
WRITE OUT-REC
END-PERFORM.
# Copybook → schema, Program → PySpark
from pyspark.sql import functions as F
from pyspark.sql.types import *
# Parsed from copybook ACCT-REC
schema = StructType([
StructField("acct_id", StringType()),
StructField("acct_bal", DecimalType(11,2)),
StructField("acct_type", StringType()),
StructField("open_date", StringType()),
])
df = spark.read.schema(schema) \
.format("csv").load("/mnt/acct_file")
df = df.withColumn("risk_flag",
F.when(F.col("acct_bal") > 100000, "HIGH")
.otherwise("STD"))
df.write.format("delta").mode("overwrite") \
.saveAsTable("acct_risk_scored")
PIC clauses become typed schema fields. COMP-3 packed decimal becomes DecimalType. PERFORM loops become DataFrame operations. VSAM and flat files land as Delta Lake tables.
| COBOL / Mainframe Component | Databricks Equivalent | Notes |
|---|---|---|
| COBOL program | PySpark notebook / job | Batch logic as DataFrame operations |
| Copybook (PIC clauses) | StructType schema | All PIC types mapped (X, 9, S9, V) |
| REDEFINES | Conditional schema parsing | Union types handled |
| OCCURS / OCCURS DEPENDING ON | ArrayType | Fixed and variable-length arrays |
| COMP-3 (packed decimal) | DecimalType | Precision and scale preserved |
| 88-level condition names | F.when() conditions | Named conditions as filter logic |
| PERFORM loops | DataFrame transformations | Sequential → parallel processing |
| EVALUATE / IF-ELSE | F.when().when().otherwise() | Business rules preserved |
| VSAM KSDS / ESDS | Delta Lake table | ACID storage with key ordering |
| Flat file (FB/VB) | Delta Lake table | Fixed/variable record layouts parsed |
| DB2 SQL (EXEC SQL) | spark.sql() | Embedded SQL preserved |
| JCL job stream | Databricks Workflow | EXEC steps → task DAG |
| JCL DD statements | Mount / table references | Dataset routing preserved |
Data Matching compares mainframe production output against Databricks results — record by record, field by field. Packed decimal precision, date formats, and sign handling are all verified before cutover.
See how Data Matching works →Batch COBOL programs with copybooks, VSAM files, and JCL job streams converted to PySpark notebooks on Databricks. Packed decimal and REDEFINES handling validated. JCL converted to Databricks Workflows. All outputs verified with Data Matching before mainframe decommission.
View case studies →Send us a copybook and sample program. Get parsed schema, PySpark code, and a validation report.