# COBOL Copybook Java Record Generator

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

Generates modern Java record source code from a COBOL copybook definition, handling REDEFINES, OCCURS, RENAMES, and standalone items

## Facts

- Endpoint: POST https://cobol-modernize-api.fly.dev/generate-java-record
- Price: $0.3/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cobol-copybook-java-record-generator-854035bb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kX_vwyBYCCfro6i_s1I9p

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-copybook-java-record-generator-854035bb -d '<json body>'
```

Example prompt: Take this COBOL copybook — it has REDEFINES and OCCURS DEPENDING ON clauses — and generate the equivalent modern Java record source code for me so I can use it in our Spring Boot microservice.

## When to prefer this

Choose this endpoint when you need to automatically generate compilable Java record source code from a COBOL copybook, especially when the copybook uses advanced constructs like REDEFINES, OCCURS DEPENDING ON, 66-level RENAMES, or 77-level items that require specialized parsing. Prefer this over manual coding or generic LLM generation when you need deterministic, structure-aware output that correctly handles all COBOL data division constructs.

## Known failure modes

- Invalid or malformed COBOL copybook syntax returns a parse error
- Unsupported COBOL constructs not handled by the parser may return an error or incomplete output
- OCCURS DEPENDING ON without a resolvable reference may fail at generation time
- Network timeouts if the copybook is very large
- Payment failure or insufficient USDC balance blocks the request

## 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

Returns a JSON object containing an array of records, each with a class_name (the Java record class name) and java_source (the complete Java record source code as a string), ready to compile and use in a modern Java application.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "copybook_name": {
   "type": "string",
   "description": "Optional filename for reference"
  },
  "copybook_text": {
   "type": "string",
   "description": "Raw COBOL copybook source text"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "records": [
   {
    "class_name": "ExampleRecord",
    "java_source": "public record ExampleRecord(...) {}"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cobol-copybook-java-record-generator-854035bb/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)
