read_records
Decode Japanese mainframe EBCDIC records with a COBOL copybook into nested JSON, reporting unmapped bytes, gaiji, broken SO/SI, and invalid packed or zoned numbers by field path and byte offset.
Instructions
Decode records of a Japanese mainframe data file (fixed-length, or variable with RDW) using a copybook. Returns nested JSON per record plus issues located by field path and byte offset (pos is 1-based): unmapped bytes, 外字 (gaiji, shown as 〓), broken SO/SI, invalid packed/zoned numbers. Code page and RDW are detected unless given; read the notes. Read a few records first (limit).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"copybook": "<copybook>"
},
"name": "read_records"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rdw | No | RDW variable-length records; omit to detect | |
| use | No | REDEFINES readings to use: ["ADDR-JP"] for every record, or by record type: ["HOJIN-DETAIL:TOR-KBN=1", "KOJIN-DETAIL:TOR-KBN=2"]; the other readings are omitted | |
| path | Yes | Absolute path to the data file | |
| skip | No | ||
| limit | No | ||
| lrecl | No | ||
| record | No | ||
| codepage | No | ibm930 = katakana in single-byte (no lowercase); ibm939 = Latin with lowercase. auto detects it and says what it assumed in notes. | auto |
| copybook | Yes | Absolute path to the COBOL copybook | |
| copybook_encoding | No | auto = UTF-8, else Shift_JIS (cp932) | auto |