Skip to content

COBOL engine: IDMS IDMS-CONTROL SECTION / PROTOCOL. (ENVIRONMENT DIVISION) recorded as procedure units #4306

Closed

Description

@squid-protocol

Problem

CA IDMS programs carry an IDMS-CONTROL SECTION. with a PROTOCOL. MODE IS ... paragraph in the ENVIRONMENT DIVISION. The func_start shield (cobol.py, reserved header list: SOURCE-COMPUTER, SPECIAL-NAMES, FILE-CONTROL, ...) does not list them, so both become function_data units. That adds 2 phantom units per IDMS program and splits nothing real.

Evidence (language-crucible v1.7.0, main and #4290 head)

  • che-che4z_lsp_project_fixtures/cobol-idms_IDMSSMPL.cbl:6-7 (006800 IDMS-CONTROL SECTION. / 006900 PROTOCOL. MODE IS IDMS-DC-NONAUTO DEBUG.) gives units IDMS-CONTROL, PROTOCOL.
  • Same in cobol-vanila_IDMSSMPL.cbl, cobol-idms_DACOSMPL.cbl, cobol-daco_DACOSMPL.cbl, cobol-vanila_DACOSMPL.cbl and cobol-dc_ABCD.cbl (6 files, 12 phantom units).

Acceptance criteria

  • Units are only taken from the PROCEDURE DIVISION (structural fix), or IDMS-CONTROL / PROTOCOL join the reserved-header shield
  • Fixture from the IDMSSMPL shape

Related: #3975 (IDMS extraction epic). This is only the phantom-unit symptom.

Found during: crucible mainframe count audit (2026-10-04)

Found by a grep-vs-engine count audit of every mainframe file in language-crucible v1.7.0 (802 of 815 files compared), on main 737cab8 and the #4290 head (now merged as c136f46).

Activity

  1. added
    bug
    core-engine
    legacy-modernization
    priority: low
    on Oct 4, 2026
  2. squid-protocol commented on Oct 4, 2026

    @squid-protocol
    OwnerAuthor

    Another shape of this bug, found by estate-crucible (#4317, v0.1.0 H-0007): the IDMS SCHEMA SECTION in the DATA DIVISION is also recorded as a procedure unit. Here it swallows the WORKING-STORAGE lines after it.

    Minimal reproducer, main 25f9233. Units: IDMS-CONTROL 4-4, PROTOCOL 5-5, SCHEMA 7-10, MAIN-PARA 12-15. Expected: MAIN-PARA only.

           IDENTIFICATION DIVISION.
           PROGRAM-ID. IDMSSCH.
           ENVIRONMENT DIVISION.
           IDMS-CONTROL SECTION.
           PROTOCOL.    MODE IS IDMS-DC DEBUG.
           DATA DIVISION.
           SCHEMA SECTION.
           DB LOANSS01 WITHIN LOANSCHM.
           WORKING-STORAGE SECTION.
           01  WS-KEY                 PIC X(12).
           PROCEDURE DIVISION.
           MAIN-PARA.
               BIND RUN-UNIT
               FINISH
               GOBACK.

    estate-crucible v0.1.0: estate/apps/LOAN/cobol/LNIDMS01.cbl:12 (SCHEMA SECTION.) gives the phantom unit SCHEMA.

    This supports the structural fix in the first acceptance criterion: take units only from the PROCEDURE DIVISION. A reserved-name shield would need SCHEMA added as well, and other dictionary-driven sections (for example MAP SECTION in IDMS-DC programs) would still slip through.

  3. added 2 commits that reference this issue on Oct 5, 2026
  4. added
    scope:frontier
    era:2
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-engineera:2legacy-modernizationpriority: lowscope:frontier

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions