# COBOL Decode Record API

> COBOL Decode Record API is a paid API for AI agents from cobol-modernize-api.fly.dev, paid per call via x402, $2/call, status unknown (last checked 2026-09-13).

Decodes raw EBCDIC/packed-decimal mainframe binary records into structured field values using a COBOL copybook definition

## Facts

- Endpoint: POST https://cobol-modernize-api.fly.dev/decode-record
- Price: $2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cobol-decode-record-api-bcca4d7e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YxLBlwhUjQwqLpuPfR0D4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability cobol-decode-record-api-bcca4d7e -d '<json body>'
```

Example prompt: I have a raw EBCDIC binary mainframe record and a COBOL copybook that defines its layout — can you decode the record into readable field values, handling the REDEFINES and OCCURS DEPENDING ON clauses in the copybook?

## When to prefer this

Choose this endpoint when you need to decode raw binary EBCDIC or packed-decimal mainframe records using a COBOL copybook definition, especially when the copybook contains complex features like REDEFINES with group-level alternates, OCCURS DEPENDING ON variable-length groups, 66-level RENAMES, or 77-level standalone items. It is ideal for mainframe modernization pipelines where you need to extract structured data from legacy binary files without standing up a full mainframe environment.

## Known failure modes

- Invalid or malformed COBOL copybook syntax causes parsing failure
- Binary record length does not match copybook-defined record length
- OCCURS DEPENDING ON runtime count field missing or out of range
- Unsupported COBOL syntax or level types in copybook
- Malformed packed-decimal or EBCDIC encoding in record data
- Payment not received or insufficient funds causes request rejection

## How this service works

Tools for mainframe modernization projects: convert COBOL copybooks to JSON schema, decode real EBCDIC/packed-decimal mainframe records into field values (schema validation against sample data), and generate modern Java record source code directly from a copybook. Handles REDEFINES (including group-level alternate layouts), OCCURS and OCCURS DEPENDING ON (variable-length repeating groups, resolved at decode time using the actual runtime count), 66-level RENAMES, and 77-level standalone items. Accepts payment on Base, Polygon, Arbitrum, and Solana (USDC) - pick whichever network your wallet holds funds on.

## Output

A JSON response containing a record_count and an array of decoded_records, where each record maps COBOL field names to their decoded values extracted from the raw binary data, with REDEFINES branches resolved, OCCURS/OCCURS DEPENDING ON groups expanded, and packed-decimal/EBCDIC values converted to native types.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "record_schema": {
   "type": "object",
   "description": "A recordLayouts[i] entry from /parse-copybook"
  },
  "raw_records_base64": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "1-1000 base64-encoded sample records"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "record_count": 1,
  "decoded_records": [
   "..."
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cobol-decode-record-api-bcca4d7e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cobol-modernize-api.fly.dev](https://www.zero.xyz/host/cobol-modernize-api.fly.dev/llms.txt)
