{"uid":"cap_YxLBlwhUjQwqLpuPfR0D4","slug":"cobol-decode-record-api-bcca4d7e","name":"COBOL Decode Record API","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/decode-record","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":{"type":"json","example":{"record_count":1,"decoded_records":["..."]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"2","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":"$2/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"2","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"2","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NmJRxH-FVseASpc4t0h8b","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"2","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Decodes raw EBCDIC/packed-decimal mainframe binary records into structured field values using a COBOL copybook definition","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Mainframe payroll record extraction","prompt":"I've got a blob of raw packed-decimal payroll data from our IBM mainframe and the COBOL copybook that describes it — can you decode this record into readable fields so I can see the employee ID, salary, and deduction amounts?"},{"title":"Variable-length order record decoding","prompt":"Our legacy system exports order records with OCCURS DEPENDING ON groups where the repeat count varies per record. I have the binary data and the copybook definition — can you decode this record and resolve the variable-length repeating line items into structured JSON?"},{"title":"REDEFINES alternate layout parsing","prompt":"I have a mainframe customer record that uses REDEFINES to represent either a domestic or foreign address depending on a type flag. Here's the raw binary record and the copybook — can you decode it and show me which REDEFINES branch applies along with all the field values?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:33:29.465Z","isFirstParty":false}