Skip to content

COBOL engine: EXEC SQL CALL proc is recorded as a COBOL dynamic CALL (operand = the schema qualifier) #4304

Closed

Description

@squid-protocol

Problem

mainframe_boundary._CALL_IDENTIFIER and the calls_out rule scan the whole code stream, EXEC SQL blocks included. A DB2 stored-procedure call is therefore recorded as a COBOL program call:

  • EXEC SQL CALL MYSCHEMA.GETCUST (:WS-A) END-EXEC gives call_site_data CALL / identifier / MYSCHEMA (target NULL) and calls_out_to MYSCHEMA. The procedure name is lost; only the schema is kept.
  • EXEC SQL CALL UPDPROC END-EXEC gives CALL / identifier / UPDPROC.

sql_statement_data records both correctly as verb CALL.

Evidence

Minimal repro REPRO7.cbl (below), identical on main 737cab8 and #4290 head. The crucible has no EXEC SQL CALL, so no corpus file shows it.

Impact

Each stored-procedure call becomes an unresolved dynamic program CALL. That inflates the missing-inputs / unresolved-call reports and puts a phantom node (the schema name) in the call graph. DB2 shops use stored procedures widely.

Acceptance criteria

  • CALL inside EXEC SQL / EXEC DLI / EXEC CICS blocks is not a COBOL CALL site (mask the blocks, as the audit does)
  • Optional: carry the SQL CALL's procedure name (schema.proc) on sql_statement_data, or as its own edge kind
  • Repro gives 0 COBOL call sites and 2 SQL CALL statements

Related: #4269 (translator SQL breadth; this is the engine side).

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

Reproducer

REPRO7.cbl

       IDENTIFICATION DIVISION.
       PROGRAM-ID. REPRO7.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-A                   PIC X(4).
       PROCEDURE DIVISION.
       MAIN-PARA.
           EXEC SQL
               CALL MYSCHEMA.GETCUST (:WS-A)
           END-EXEC
           EXEC SQL CALL UPDPROC END-EXEC
           STOP RUN.

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
    on Oct 4, 2026
  2. added
    scope:sweep
    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: mediumscope:sweep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions