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

COBOL structure analyser

See a COBOL program's paragraphs, PERFORM and GO TO links, CALLs, files and unreachable code.Use this when you have inherited a COBOL program and want to see how its paragraphs connect, what it calls and which paragraphs nothing reaches.

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

What it does

Reads one COBOL program and shows its paragraphs, PERFORM and GO TO links, CALLs, files and paragraphs nothing reaches.

How to use it

  1. Paste one COBOL program.
  2. It is analysed as you paste; no button is needed.
  3. Read the outline, who runs whom, and any paragraphs nothing reaches.

What it cannot do

  • COPY members are not expanded, so names inside them are not seen.
  • It shows what is written, not what runs; a conditional branch is shown as possible.
  • Only one program in fixed format.

COBOL · paste one program
fixed format: code in columns 8-72on this device

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

Reads the program text and nothing else: nothing is run. COPY members are not expanded, so a paragraph brought in by COPY is not seen.

Covers: One COBOL program, in fixed format. Nested or batched programs are cut at the second PROGRAM-ID, and COPY members are not expanded.

ACCURACY · CHECKED AGAINST IBM RULES

Follows the Enterprise COBOL for z/OS rules for reference format, PERFORM, GO TO, CALL and SORT procedures. COPY members are not expanded, ALTER and REPLACE are not followed, and control flow through those or through CICS and Db2 handlers is marked as depending on the run.

What it checks

  • ConfirmedDivisions, sections and paragraphs with their line ranges, from the fixed reference format (columns 7 and 8 to 72, comment and continuation lines).
  • ConfirmedWho PERFORMs whom (including THRU ranges and loop forms), GO TO and GO TO DEPENDING ON, and SORT INPUT and OUTPUT PROCEDURE ranges.
  • ConfirmedCALL targets, marked static or dynamic: a literal is static under NODYNAM and dynamic under DYNAM; an identifier is always dynamic.
  • Depends on your systemParagraphs that no PERFORM, GO TO or fall-through reaches, with a caveat when ALTER or an entry point could change that.
  • ConfirmedFiles from FILE-CONTROL (organisation, access mode, keys, file status), COPY members, the EXEC SQL and EXEC CICS blocks with the paragraph each sits in, and a construct inventory (counts of EXEC, CALL, COPY, REDEFINES, COMP-3, OCCURS DEPENDING ON, GO TO, ALTER and more, comments and literals excluded).
  • Depends on your systemWHENEVER and HANDLE CONDITION, HANDLE AID and HANDLE ABEND branches, shown as links that happen only when the condition occurs.

What it does not check

  • UnsupportedThe inventory counts what is written, not what runs, and misses anything inside a COPY member or decided at run time; its own list says what else it cannot see.
  • UnsupportedCOPY members are never expanded and COPY REPLACING and REPLACE are not applied, so names inside them are not seen.
  • UnsupportedALTER and a GO TO with no name are not followed, so the flow that depends on them is not known.
  • UnsupportedNested or batched programs, object-oriented COBOL (CLASS-ID, METHOD-ID, INVOKE) and free-format source selected by a >>SOURCE FORMAT directive.
  • Depends on your systemWhether a condition ever occurs at run time, so a conditional branch is shown as possible, not as certain.

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

  • Program text: 200,000 characters.

EXAMPLE INPUT

       IDENTIFICATION DIVISION.
       PROGRAM-ID. DEMO.
       PROCEDURE DIVISION.
       0000-MAIN.
           PERFORM 1000-INIT.
           PERFORM 2000-WORK UNTIL DONE.
           STOP RUN.
       1000-INIT.
           CONTINUE.
       2000-WORK.
           CALL 'SUBPROG'.
       9999-OLD.
           CONTINUE.

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'