Skip to content

Engine: SIGN ... SEPARATE DISPLAY items are sized one byte short (record layouts) #3694

Closed

Description

@squid-protocol

Found by the blind census of the new answer-key fields (#3649 / #3602).

The engine sizes COBOL PIC S9(n) DISPLAY SIGN LEADING|TRAILING SEPARATE [CHARACTER] items as n bytes. The SEPARATE sign takes its own byte, so the right size is n + 1.

Where: CBSA src/base/cobol_copy/ABNDINFO.cpy. ABND-RESPCODE, ABND-RESP2CODE and ABND-SQLCODE are PIC S9(8) DISPLAY SIGN LEADING SEPARATE: 9 bytes each; the engine says 8.

Why: record_data doesn't store the SIGN clause for COBOL items at all (attributes is PL/I-only), so galaxy_ir._elementary_bytes can't know about it. It counts S as taking no storage, which is right only for an embedded sign.

Fix:

  • Record the sign clause per item: a sign_separate column in record_data, or the COBOL clause text in attributes.
  • Add the byte in _elementary_bytes.
  • Handle old databases, which lack the column, by treating it as not separate.
  • Re-run ground_truth_ledger.py update. The copybook layouts mismatches on CBSA (3 units) should then clear.

The answer key was corrected in the census PR, where the key reader had the same blind spot. Until this issue is fixed, the ledger carries those 3 units as a known engine defect (field_testing D024).

Impact: any record holding such an item is laid out 1 byte short from that item on. That affects COMMAREA / container DTO offsets (#3615), fromPrefix unpacks (#3655) and VSAM key offsets (#3617).

🤖 Generated with Claude Code

Activity

  1. added
    scope:core
    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

    era:2scope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions