What the calculated positions mean
A COBOL copybook describes physical storage hierarchically. This inspector expands repetition notation in PICTURE clauses, calculates elementary storage from the selected USAGE, places ordinary siblings sequentially, overlays REDEFINES on its earlier sibling, and multiplies fixed OCCURS items. IBM documents that REDEFINES gives alternate descriptions to the same storage area; an overlay therefore does not automatically follow its target in a new byte range.
DISPLAY reserves one byte for each stored character position in the supported single-byte profiles. An implied decimal V, operational sign S, and scaling P do not normally consume display positions, while an explicit separate sign does. Edited PICTURE symbols may be sized, but only the simple numeric subset is converted to a number.
COMP-3, binary, and floating-point storage
For packed decimal, two decimal digits share each byte and the final nibble carries the sign, so the size is ceil((digits + 1) / 2). IBM’s documentation describes COMP-3 as packed decimal. For this IBM-compatible profile, BINARY, COMP, COMP-4, and COMP-5 use 2 bytes for 1–4 digits, 4 bytes for 5–9, and 8 bytes for 10–18, matching IBM’s documented storage bands. Byte order remains explicit because non-z/OS files can differ. COMP-1 and COMP-2 always occupy 4 and 8 bytes here, but their values are decoded only under the selected IBM hexadecimal or IEEE-754 representation.
Why the supported subset is intentionally narrow
COBOL storage is compiler- and option-sensitive. SYNC can insert alignment padding. OCCURS DEPENDING ON makes logical length data-dependent. COPY requires external source expansion. NATIONAL, UTF-8, pointers, indexes, variable-length records, and vendor extensions introduce additional rules. Rejecting these features prevents an attractive but false byte map. Level 66, 78, and 88 entries do not allocate ordinary record bytes and are reported as omitted.
Verification boundary
This is an inspection aid, not a compiler. Confirm the exact compiler, dialect, options, copybook expansion, RECFM/LRECL, CCSID, endian convention, and transfer mode with the source system. Preserve original data and reconcile record counts and control totals before conversion or migration. A plausible decoded value does not prove that a field definition or code page is correct.
Frequently asked questions
Why does REDEFINES show the same offset twice?
That is its purpose: two definitions describe the same bytes. The detailed table and decoded record show both interpretations, while the physical strip avoids double-counting the overlay.
Can I paste a complete COBOL program?
The parser ignores text that is not a supported data-description entry, but it neither resolves COPY statements nor evaluates compiler directives. A self-contained single record definition is the safest input.
Does the tool remove RDWs from variable records?
No. It treats the data source as consecutive fixed-length records. Strip and validate RDW/BDW structures with source-system-aware tooling before using this page.
Why is an edited numeric field shown as text?
Formatting symbols, locale rules, and sign conventions can change interpretation. The inspector sizes supported edited PICTURE strings but converts only the bounded simple numeric subset; raw bytes remain visible.
Inspect EBCDIC bytes and code pages · Build a manual fixed-width layout · Browse legacy-data tools