Skip to content

COBOL import rule misses single-line EXEC SQL INCLUDE <member> END-EXEC #3416

Closed

Description

@squid-protocol

Found by the mainframe ground-truth ledger on CardDemo (answer key added in the CardDemo key PR). Cause: engine_sql_include_same_line.

Problem

The COBOL import rule (gitgalaxy/standards/language_standards/languages/cobol.py, around line 550) is anchored at the start of the line:

^(?:[0-9a-zA-Z \t]{6}[ \-]?)?[ \t]*(?:COPY|INCLUDE)\b

INCLUDE is only seen when it begins its own line, as in the two-line EXEC SQL / INCLUDE X form. That's why CBSA scores exact: its includes use that form. The one-line form EXEC SQL INCLUDE X END-EXEC never matches, so the COPY edge is lost.

6 missed copybook edges on CardDemo, all verified against the source:

program line member → resolves to
app/app-transaction-type-db2/cbl/COBTUPDT.cbl 54 DCLTRTYP → app/app-transaction-type-db2/dcl/DCLTRTYP.dcl
app/app-transaction-type-db2/cbl/COTRTLIC.cbl 304 CSDB2RWY → …/cpy/CSDB2RWY.cpy
app/app-transaction-type-db2/cbl/COTRTLIC.cbl 333 DCLTRTYP → …/dcl/DCLTRTYP.dcl
app/app-transaction-type-db2/cbl/COTRTLIC.cbl 2055 CSDB2RPY → …/cpy/CSDB2RPY.cpy
app/app-transaction-type-db2/cbl/COTRTUPC.cbl 286 DCLTRTYP → …/dcl/DCLTRTYP.dcl
app/app-transaction-type-db2/cbl/COTRTUPC.cbl 288 DCLTRCAT → …/dcl/DCLTRCAT.dcl

Acceptance

  • These 6 engine | copybook paths | … | fn ledger entries stop reproducing, and are ratcheted out with ground_truth_ledger.py update.
  • A registry fixture for EXEC SQL INCLUDE X END-EXEC on one line, with and without a sequence area.
  • The golden-master / rosetta re-bless this implies, as usual for a registry change.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    core-engine
    legacy-modernization
    on Sep 23, 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-enginelegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions