Mainframe modernization · Part 5

How we verify mainframe parity with a parallel run

By Ergane IO · · 4 min read

For three Medicare home health test claims, the Pricer returned payments totaling $2,695.85. We swapped two results and got the same total, the same record count and the same mix of payment codes. One claim now had $533.25 against it where the pricer had returned $1,681.11. A reconciliation report that stopped at the batch total would have cleared it.

What to compare before cutover
  1. Reference outputTarget output
  2. Match records and amounts
  3. Investigate differences

A mismatch you can reproduce

We reran the three claims through the Centers for Medicare & Medicaid Services (CMS) Home Health Java Pricer 2.6.0. All three responses matched the saved JSON field for field. Each reported calculation version 2021.3. Both sets of captured responses came from Java. The evidence for how the mainframe chose a payment method comes from the COBOL listing. CMS mainframe source, ZIP · CMS pricer release used in the replay

We chose the first two claims for our test because each had four skilled nursing visits. One qualified for a period payment and the other was paid by the visit. In a copy of the results we exchanged their payments and return codes, leaving the case IDs in place. To reproduce it, save the linked file as medicare-home-health-2021.json and run this Python in the same directory. Test requests, observed responses and pricer instructions

import json
from collections import Counter
from decimal import Decimal

with open("medicare-home-health-2021.json") as f:
    cases = json.load(f, parse_float=Decimal)["cases"]

rows = []
for case in cases:
    response = case["response"]
    code = response["returnCodeData"]["code"]
    amount = response["paymentData"]["totalPayment"]
    rows.append((case["id"], code, amount))

first, second, third = rows
swapped = [
    (first[0], *second[1:]),
    (second[0], *first[1:]),
    third,
]
for batch in (rows, swapped):
    print(sum(amount for _, _, amount in batch))

before, after = Counter(rows), Counter(swapped)
for row in sorted((before - after).elements()):
    print("missing", *row)
for row in sorted((after - before).elements()):
    print("unexpected", *row)

Both totals print as 2695.85. For case 1AA11, the comparison reports the missing 00 1681.11 and the unexpected 06 533.25. For 1AB11 it reports the reverse. The third case still matches. Counting occurrences also catches a second copy of an identical payment, which a lookup keeping only the last result for each key would lose.

The IDs identify our test cases. A payment group would make a poor claim identifier in production. Even in this small file, two different claims belong to group 1AA11. For a real replay, agree on the claim identifier and how adjustments to the same claim are distinguished. Then compare the fields people act on. For the physical therapy case, that includes the $481.49 on revenue line 0420 and its zero add-on. A correct total can still put money on the wrong line.

Where the reference payments come from

For an actual migration, capture the incumbent system’s outputs before an agent changes the implementation. Keep the original input, starting state, rate-table version, output records and rejects together so someone else can rerun the case. An agent can write the comparator. If its patch also changes an expected amount, the reviewer needs the incumbent record or a business decision authorizing the change. That distinction matters as soon as the new system is supposed to price something differently.

When both systems are running

For a production parallel run, pick a unit whose inputs and outputs can be identified on both sides. Start the target from a reconciled checkpoint and give it a copy of the same subsequent inputs. Let the incumbent issue the real postings. Route the target’s postings to a separate destination where finance can inspect them. Part 4 on choosing migration units · Google Cloud’s batch comparison workflow

Compare a batch once both sides have finished the same input range. Count accepted and rejected inputs, find missing and duplicate output keys, then check amounts, dates and destination accounts. If a payment is missing, keep the checkpoint and both raw records where available. An unfinished target job, a rejected input and an accepted payment sent to the wrong account call for different fixes.

Before cutover, finance should see a reconciled close with every monetary difference explained. Operations should have measured whether the target finishes in the batch window and rehearsed recovery after a posting has already been accepted. At handover, record the last input the incumbent owns and the first one the target will process. That is the point a recovery team will need if someone proposes running the batch again.

← All parts in this series