Skip to content

COBOL engine: entries continuing a COPYed record are still double-counted under the preceding 01 (CardDemo COTRN02C, after #4279) #4458

Closed

Description

@squid-protocol

Problem

Entries that continue a COPYed record are still double-counted when the COPY follows a separate 01 in the program: they land in the copied record (right, via _copy_extension) and under the preceding program 01 (wrong). #4279 fixed the case where the COPY closes a nested group; this one survives.

Evidence (engine origin/main e3ace8a, #4273 cross-check)

CardDemo app/cbl/COTRN02C.cbl:62-73:

       01 CSUTLDTC-PARM.
          05 CSUTLDTC-DATE ... 10 CSUTLDTC-RESULT-MSG PIC X(61).
       COPY COCOM01Y.
          05 CDEMO-CT02-INFO.
             10 CDEMO-CT02-TRNID-FIRST ...

GalaxyIR.record_layout(COTRN02C, CSUTLDTC-PARM) = 158 bytes, with CDEMO-CT02-TRNID-FIRST @100 ... CDEMO-CT02-TRN-SELECTED @142. The same six fields also appear, correctly, in CARDDEMO-COMMAREA (COCOM01Y + extension) at 160..202. CSUTLDTC-PARM is 100 bytes (the det translator, which compiled and proved this program against GnuCOBOL, has 100). The experiment of 2026-10-03 (#4273, bug 3) found exactly this record.

Impact on a real estate

A wrong record size and phantom fields for CSUTLDTC-PARM: the parameter block COTRN02C passes to CSUTLDTC. Any CALL-interface or layout consumer gets 158 bytes.

Acceptance criteria

  • Entries after a section-level COPY that continue the copied record are not children of the 01 before the COPY (CSUTLDTC-PARM = 100 bytes).
  • The cross-check ledger cause engine-copy-continuation-double-count loses its 7 entries.

Found during: #4273 engine-vs-translator fact cross-check (PR #4456)

🤖 Generated with Claude Code

Activity

  1. added
    bug
    core-engine
    data-integrity
    legacy-modernization
    on Oct 5, 2026
  2. added a commit that references this issue on Oct 5, 2026
  3. added
    scope:core
    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-enginedata-integritylegacy-modernizationpriority: mediumscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions