Practical tutorials for mainframe learners and working developers.
COBOLA batch report can have correct totals and still be operationally unusable when headings appear in the middle of detail, page numbers drift, or a final page is never closed cleanly. This tutorial shows a small, controlled pattern for `WRITE ... AFTER ADVANCING` page control and the evidence to review before changing an existing report.
Read article →
COBOL`SEARCH ALL` is attractive because it can locate a row in a large COBOL table with fewer comparisons than a sequential `SEARCH`. Its hidden precondition is more important than its speed: the active rows must already be ordered exactly as the search key and sort direction expect.
Read article →
COBOLAn internal COBOL `SORT` is often introduced as a convenient way to order a file. In a production batch program, the harder problem is proving that every eligible record was released once, returned once, and written once when input and output procedures are involved.
Read article →
JCLA batch job can fail before its program gets control because an output dataset cannot be allocated or extended. This guide shows how to distinguish an initial-allocation problem from an extension problem, collect evidence that matters, and make a controlled correction without treating `SPACE` as a number to keep increasing.
Read article →
COBOLA variable-length COBOL record can look valid until an `OCCURS DEPENDING ON` count says there are more repeated items than the record actually contains. This tutorial shows how to validate that control field before using it for business processing, and how to investigate a bad input record without turning a batch rerun into duplicate work.
Read article →
MainframeA batch failure often leaves useful evidence scattered across scheduler notes, JCL, messages, and handover comments. This article shows how to use an AI assistant to draft a recovery runbook from **sanitized** evidence while keeping technical decisions, authorization, and production actions with human reviewers.
Read article →
JCLA downstream job cannot find a GDG generation, and the tempting response is to recreate it or alter the relative generation number. That can turn a normal retention event into a data-integrity incident. This runbook shows how to establish what happened before changing JCL or rerunning a producing step.
Read article →
DB2A batch program that expects one control row can fail with SQLCODE `-811` when its `SELECT INTO` finds two or more rows. The immediate failure is clear; the safe correction depends on proving which row, if any, was supposed to be unique.
Read article →
JCLA later batch step can fail because a temporary data set was never made available to it, even though the creating step appears to have completed. This guide shows how to distinguish a `DISP=PASS` lifecycle problem from a wrong step name, a conditional bypass, or a restart that invalidates the original job context.
Read article →
CICSA CICS transaction that unexpectedly skips validation, sends the wrong response, or ends before its caller finishes may have a program-control problem rather than a business-rule defect. This design note shows how to decide between `LINK` and `XCTL`, and how to prove the intended return path before changing a live transaction flow.
Read article →
CICSA CICS transient data queue (TDQ) can be part of a reliable handoff from an online transaction to deferred processing. When the receiving work appears twice, however, the queue definition is an easy target and often the wrong one. This runbook shows how to separate duplicate producer execution, trigger-level behavior, and consumer recovery before changing a TDQ or replaying work.
Read article →
COBOLA COBOL compile can succeed while using an older or unintended copybook from a concatenated `SYSLIB`. This guide shows how to establish the member-search order, prove the member actually selected by the compiler, and correct the owning build definition without changing application logic on assumption.
Read article →
CICSA CICS transaction can appear to lose an input value even though the screen program placed it in a container successfully. This tutorial shows how to trace state through a `LINK` using channels and containers, and how to distinguish an application contract problem from an incorrect assumption about task state.
Read article →
COBOL`FILE STATUS 39` at `OPEN` often means the program and the allocated dataset disagree about record attributes. This incident guide shows how to prove which attributes differ, separate a deployment or JCL issue from a layout change, and avoid a risky “fix” that merely lets the job run against the wrong file.
Read article →
COBOLA mixed-record interface can contain a header, many details, and a trailer in one sequential file. `REDEFINES` makes each layout available, but it does not tell COBOL which layout is present. This tutorial shows a safe way to classify the record first, then use the appropriate overlay without turning a malformed header or trailer into a business transaction.
Read article →
DB2A batch step that becomes slow after DB2 statistics maintenance is not automatically a DB2 defect, and it is not automatic evidence that a new index is needed. This incident guide shows how to collect the right comparison evidence, read a small EXPLAIN result, and choose a safe next action without changing production objects on a guess.
Read article →
JCLLearn how JCL IF/THEN/ELSE conditions and clear return-code rules protect claims batch flows from unsafe downstream processing.
Read article →
COBOLLearn a safe AI-assisted workflow for COBOL copybook impact analysis, including source discovery, JCL tracing, validation, and controlled testing.
Read article →
CICSLearn a practical COBOL/CICS pattern for handling BMS MAPFAIL, validating fields safely, routing PF keys, and supporting reliable online screens.
Read article →
DFSORTLearn practical DFSORT control cards for identifying exact duplicate claim records, preserving evidence, and making safe downstream batch decisions.
Read article →
CICSLearn a practical CICS pseudo-conversational design using COMMAREA, EIBCALEN, MAPFAIL, PF-key handling, and production support safeguards.
Read article →
DB2Learn how to diagnose DB2 SQLCODE -805 in COBOL batch support by checking package identity, plan resolution, release alignment, and safe restart decisions.
Read article →
CICSLearn a safe CICS TSQ lifecycle for temporary storage queues, including queue naming, WRITEQ/READQ/DELETEQ TS, cleanup, diagnostics, and production support.
Read article →
VSAMLearn practical VSAM KSDS file status handling in COBOL batch support, including reads, updates, recovery checks, and support-friendly diagnostics.
Read article →
JCLLearn a safe JCL restart approach for production batch support, including PROCSTEP restarts, GDG handling, return codes, and restart checklists.
Read article →
COBOLLearn how COBOL file handling works with SELECT, FD, OPEN, READ, WRITE, CLOSE, and file status checks.
Read article →
JCLUnderstand the three core JCL statements used in almost every mainframe batch job: JOB, EXEC, and DD.
Read article →
JCLLearn how JCL return codes control step execution using COND, IF/THEN/ELSE, and production-safe patterns.
Read article →
JCLUnderstand GDG datasets, relative generations, and common JCL usage patterns for daily batch processing.
Read article →
DB2Learn how DB2 cursors work in COBOL programs and when to use DECLARE, OPEN, FETCH, and CLOSE.
Read article →
DB2Understand how DB2 indexes influence access paths and why EXPLAIN matters for performance tuning.
Read article →
CICSLearn how a CICS transaction moves from terminal input to program execution and response display.
Read article →
CICSUnderstand how COMMAREA passes data between CICS programs and pseudo-conversational transactions.
Read article →
VSAMLearn what a VSAM KSDS is, why it is used, and how mainframe programs access keyed records.
Read article →
Production SupportLearn common mainframe abends such as S0C7, S0C4, SB37, and how to approach production troubleshooting.
Read article →
ModernizationPractical ways to use AI for mainframe documentation, test cases, summaries, and modernization support with guardrails.
Read article →
DB2A runbook-style guide to diagnosing DB2 SQLCODE -818, proving the runtime package and load-module path, and making a safe rerun decision.
Read article →
DB2A DB2 batch step that ends with `SQLCODE -911` or `SQLCODE -913` has lost work, but it has not necessarily identified the cause. This incident guide explains how to separate a deadlock or timeout symptom from the recovery decision, collect evidence without exposing business data, and design a retry that does not duplicate processing.
Read article →
COBOLA COBOL batch program can fail while reading a numeric field even when the dataset allocated successfully and the record length looks correct. This tutorial shows how to investigate a suspected invalid packed-decimal (`COMP-3`) value without guessing at the bad record, changing a copybook blindly, or rerunning a job that may already have produced partial business effects.
Read article →
DB2A DB2 column that is allowed to be NULL does not automatically have a safe COBOL representation. This guide shows how indicator variables prevent `SQLCODE -305` and, more importantly, how they help a batch or online program distinguish an absent value from a real zero, blank, or default.
Read article →
COBOLA variable table in a COBOL record is easy to read incorrectly: the program sees a maximum number of occurrences, while the business record declares how many are meaningful. This tutorial shows how to validate that declared count, process only valid occurrences, and collect enough evidence before treating a count problem as a data or program defect.
Read article →
CICSA CICS transaction that fails near `SYNCPOINT` leaves an important question: did the business update take effect, roll back, or reach an uncertain external boundary? This runbook explains how to collect enough evidence before anyone retries an online request or asks a customer to submit it again.
Read article →
JCLA batch abend can leave a dataset cataloged, retained, deleted, or unavailable depending on its JCL disposition and the point of failure. This article shows how to reason about `DISP` outcomes before a rerun, so a support team does not accidentally feed an incomplete or wrong-cycle file into the next step.
Read article →
DB2A `SQLCODE` of `+100` is often described as “not found,” but that description is too broad for batch support. This guide shows how to distinguish a normal end-of-cursor from a missing control-table row that should stop a job before it produces incomplete or incorrectly scoped output.
Read article →
COBOLAn outbound fixed-width file can be technically complete yet still be unsafe to consume. A trailer record with deliberate control totals gives the sender and receiver a compact way to detect a truncated file, a wrong extract population, or an amount conversion error before business processing begins.
Read article →
DB2An `SQLCODE -803` on an `INSERT` tells you that DB2 rejected a duplicate value for a unique index or constraint. It does not tell you whether the source contains a genuine duplicate, an earlier attempt already committed the row, or the program built the key incorrectly. That distinction determines whether a restart is safe.
Read article →
DFSORTWhen an inbound file and a downstream extract disagree, a support team needs to know *which keys* are missing, extra, or changed before choosing a restart action. DFSORT `JOINKEYS` can produce that comparison without writing a COBOL program, provided the record layouts and comparison key are understood.
Read article →
JCLA cataloged procedure can make a batch stream consistent across applications, but its symbolic parameters can also hide the dataset name a step will actually use. This guide shows how to trace an override from the JOB statement to the expanded JCL before a run reads a test, prior-cycle, or unintended interface file.
Read article →
CICSA CICS transaction that says “record not found” may be handling an expected business condition—or it may be reducing an allocation, security, or data-definition problem to an unhelpful screen message. This tutorial shows how to capture `RESP` and `RESP2` around a keyed VSAM `READ`, separate an expected absence from a technical failure, and preserve evidence before a recovery decision.
Read article →
COBOLA COBOL `FILE STATUS` value of `35` at `OPEN` is often reported as “the program cannot find its file.” That description is too broad to support a safe fix. This guide shows how to separate a missing or unavailable DD allocation from an application assumption, and how to collect enough evidence before requesting a rerun.
Read article →
DB2A DB2 batch program that receives SQLCODE `-904` has found a resource that DB2 cannot currently use. This guide shows how to turn that broad message into evidence and a safe decision, rather than treating it as an ordinary lock wait or immediately rerunning the job.
Read article →
COBOLA sequential COBOL job can finish with a clean return code yet still produce an extra transaction if its end-of-file loop processes a record area after a failed read. This tutorial shows the control flow that prevents that failure, the evidence to collect when totals disagree, and how to test the last-record boundary safely.
Read article →
COBOLA fixed-length interface can be structurally wrong while still looking like ordinary data to a COBOL program. This guide shows how to detect a record-layout shift early, preserve useful evidence, and avoid processing amounts or keys from the wrong byte positions.
Read article →
DB2A long-running COBOL batch update may encounter one invalid business record after hundreds of valid changes. This article explains when a DB2 `SAVEPOINT` can contain that one unit of work, what evidence is needed before continuing, and why it is not a substitute for a restart design.
Read article →
DFSORTA batch failure often requires a small record-level extract to explain a mismatch, but copying the original input file into a ticket or email can expose data that the recipient does not need. This tutorial shows a controlled DFSORT pattern for retaining the fields needed for diagnosis while masking or omitting sensitive fields.
Read article →
VSAMA COBOL load can write successfully to a VSAM KSDS until one record fails with file status `22`. When the cluster has an alternate index, the visible primary key may be unique while a different field is violating a uniqueness rule. This incident guide shows how to prove which key failed and how to choose a safe correction without turning a data-control problem into a blind rerun.
Read article →