{"uid":"cap_2oHf4_22E69VvPVb3guLd","slug":"cobol-copybook-mainframe-modernization-api-parse-copybook-e7d97a90","name":"COBOL Copybook & Mainframe Modernization API - Parse Copybook","description":"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.","url":"https://cobol-modernize-api.fly.dev/parse-copybook","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"copybook_name":{"type":"string","description":"Optional filename for reference"},"copybook_text":{"type":"string","description":"Raw COBOL copybook source text"}}},"responseSchema":{"type":"json","example":{"schema":{"...":"..."},"field_count":5,"record_size":35}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.25","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_U5DWfOYZF4KMvzjUukGMF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a COBOL copybook definition into a JSON schema, decodes raw EBCDIC/packed-decimal mainframe records into field values, and generates Java record source code from the copybook structure","exampleAgentPrompt":"I have a COBOL copybook with REDEFINES and OCCURS DEPENDING ON clauses that I need modernized — can you parse it and give me the JSON schema plus generate the equivalent Java record class from it?","exampleUseCases":[{"title":"Modernize legacy customer record layout","prompt":"I have a COBOL copybook defining a customer master record with several REDEFINES sections and packed-decimal fields — can you convert it to a JSON schema and generate a Java record class so I can use it in our new Spring Boot service?"},{"title":"Decode raw EBCDIC mainframe extract","prompt":"We pulled a binary mainframe data extract in EBCDIC format and I have the matching COBOL copybook — can you decode the raw record bytes against the copybook so I can see what values each field holds?"},{"title":"Validate copybook against sample data","prompt":"I want to check that our COBOL copybook definition matches our actual mainframe sample records — can you run schema validation using this copybook and a few raw EBCDIC sample records to confirm the field layouts are correct?"}],"resultDescription":"Returns a JSON object containing a JSON schema derived from the COBOL copybook (with all fields, types, and structure), the total field count, the computed record size in bytes, and optionally decoded field values from a provided raw EBCDIC/packed-decimal record or generated Java record source code.","failureModes":["Invalid or unparseable COBOL copybook syntax returns an error","Mismatched record size between copybook definition and provided binary data causes decode failure","Unsupported COBOL constructs not covered by the parser return an unsupported-feature error","Missing or malformed OCCURS DEPENDING ON runtime count causes variable-length resolution failure","Payment failure or insufficient USDC balance blocks the request","Network timeout on the fly.dev host under heavy load"],"whenToPreferThis":"Choose this endpoint when you need to programmatically modernize COBOL copybook definitions as part of a mainframe migration pipeline, especially when dealing with complex constructs like REDEFINES, OCCURS DEPENDING ON, 66-level RENAMES, or 77-level standalone items that simpler tools cannot handle. It is the right choice when you need all three outputs — JSON schema, decoded field values, and Java record code — from a single API call rather than stitching together multiple tools.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:38:48.275Z","isFirstParty":false}