Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

Copybook viewer

Paste a COBOL copybook and see every field's position, length and type.Use this when you need a field's position, length or the total record length (LRECL) from a copybook.

Checked against IBM rulesON THIS DEVICE · NOTHING UPLOADEDCounting requests…
How to use this tool

What it does

Reads a COBOL copybook and lists every field with its start position, length and type, plus the total record length.

How to use it

  1. Paste your COBOL copybook, or press Example.
  2. The table appears as you paste; no button is needed.
  3. Read each field's start, length and type, and the record length.

What it cannot do

  • It does not expand COPY or REPLACE and does not show RENAMES.
  • It measures the layout from the text; the compiler's own storage map is final.

Learn view adds a plain-English note under each field type. Compact hides the notes.
COPYBOOK · paste the source
on this device

Your copybook is kept in this browser to save retyping. Clear it or keep it for this tab only on the Privacy page.

Level numbers 01-49, 66, 77 and 88; PIC, USAGE, OCCURS (DEPENDING ON), REDEFINES, SIGN and SYNC are understood. Sequence numbers in columns 1-6 and 73-80 are ignored.

Not covered: this viewer reads the data layout only. It does not expand COPY or REPLACE, show RENAMES (level 66), or apply VALUE, BLANK WHEN ZERO or JUSTIFIED. Edited and floating-point pictures are measured but not converted, and COMP-1 and COMP-2 are read as hexadecimal floating point, not IEEE. SYNC padding follows IBM's rule but is still an estimate, so check it against the compiler's map. The compiler options TRUNC and NSYMBOL are not applied, and a plain PIC N is read as national text. Double-byte text is shown as hex. For a table with OCCURS DEPENDING ON, items after it are placed after the actual table length, but SYNC alignment of those items is not recomputed for smaller counts. Always compare the result with your compiler's own storage map before relying on it.

DECODE A DATA FILE WITH THIS COPYBOOK ▸

Hands this copybook text to the record decoder on this device. You then choose the data file there; nothing is changed or sent anywhere.

ACCURACY · CHECKED AGAINST IBM RULES

Sizes follow Enterprise COBOL storage rules (PIC, COMP, COMP-3, OCCURS, REDEFINES) and are covered by known-answer tests. SYNC slack bytes are an estimate (confirm with the compiler MAP listing), and compiler options such as TRUNC are not modelled.

What it checks

  • ConfirmedPosition, length and type of every field, from PIC and USAGE (DISPLAY, COMP, COMP-3, COMP-1, COMP-2).
  • ConfirmedTotal record length (LRECL), with OCCURS tables sized by their maximum count.
  • ConfirmedREDEFINES overlays, so fields that share the same bytes are marked.
  • ConfirmedBinary size by digits (2, 4 or 8 bytes) and COMP-3 size (digits / 2 + 1 bytes).
  • Depends on your systemSYNC slack bytes, using IBM's boundary rule; the compiler's own storage map is final.
  • ConfirmedA Gotchas panel under the export: for packed decimal, signs, binary byte order, EBCDIC text, REDEFINES and OCCURS DEPENDING ON, it shows only the cards that match a field in your layout, names those fields, and cites the IBM page.

What it does not check

  • UnsupportedCOPY and REPLACE are not expanded, and RENAMES (level 66) is not shown.
  • UnsupportedVALUE, BLANK WHEN ZERO and JUSTIFIED are not applied; edited and floating-point pictures are measured but not converted.
  • Depends on your systemCompiler options such as TRUNC and NSYMBOL are not applied; check the compiler's own storage map.
  • UnsupportedDouble-byte text is shown as hex, and a plain PIC N is read as national text.
  • UnsupportedSYNC alignment of items after an OCCURS DEPENDING ON table is not recomputed for smaller counts.

Source

Checked against IBM rules. Status labels: Confirmed Depends on your system Unsupported (a rule with an official source; depends on your catalog, security, installation defaults or compiler options; not parsed and shown instead of guessing).

Input limits and example

  • Copybook text: 200,000 characters.
  • The layout list shows up to 5,000 fields; the rest are not listed.

EXAMPLE INPUT

       01  CUSTOMER-REC.
           05  CUST-ID     PIC 9(6).
           05  CUST-NAME   PIC X(20).
           05  BALANCE     PIC S9(7)V99 COMP-3.

Check it yourself in one minute

  1. Open your browser's developer tools: in Chrome or Edge press F12 or right-click and choose Inspect; in Firefox press Ctrl+Shift+E for the Network Monitor; in Safari first turn on Show features for web developers under Settings, Advanced. Then open the Network tab.
  2. Keep the log across page loads (Chrome: Preserve log; Firefox: Persist Logs), then use the tool: paste your text or open a file and press the button.
  3. Look at the list. You will see only this page and its own files, loaded when the page opened. Nothing new appears when you use the tool.
  4. Still unsure? Switch Wi-Fi off and try again. The tool still works.

What the badge counts: requests the browser logged after this page finished loading, other than the site's own files. It reads the browser's own record and makes no request of its own. If your browser cannot give that record, the badge says so. The badge is a convenience; the developer tools are the proof.

The rule that enforces it

Every page carries this Content Security Policy. The browser itself refuses any request outside it; connect-src 'none' blocks fetch, XHR and WebSocket.

default-src 'none';
script-src 'self';
style-src 'self';
img-src 'self' data:;
font-src 'self';
connect-src 'none';
object-src 'none';
form-action 'none';
base-uri 'none';
manifest-src 'self';
worker-src 'self'