Skip to content

det: a LINK writes the callee's DTO back over the caller's COMMAREA -- a numeric field holding spaces the callee never wrote comes back as digits (CBSA BNK1UAC -> INQACC) #4806

Closed

Description

@squid-protocol

Found writing the CBSA BNK1UAC equivalence case (#4270). The det port of a LINK passes the caller's COMMAREA to the callee as the callee's DTO and writes the DTO back over the caller's bytes afterwards (out_<Dto>(storage) before task.link(...), in_<Dto>(dto, storage) after). A numeric DISPLAY field of the callee's layout that holds spaces in the caller's storage (the callee never writes it) comes back changed: the DTO reads the spaces as a number (-16) and writes it back as digits.

Where. CBSA BNK1UAC INQ-ACC-DATA: it INITIALIZEs its own DFHCOMMAREA (COMM-CUSTNO PIC X(10), COMM-SCODE PIC X(6): spaces) and LINKs INQACC with it. INQACC's layout (INQACC copybook) has INQACC-CUSTNO PIC 9(10), INQACC-SCODE PIC 9(6) there. For an account that is not on file INQACC only sets INQACC-SUCCESS 'N' -- the rest of the area is the caller's.

  • COBOL (GnuCOBOL oracle, and z/OS): COMM-CUSTNO / COMM-SCODE are still spaces after the LINK.
  • det port: 0000000016 / 000016 (the RETURN COMMAREA's WS-COMM-CUSTNO / WS-COMM-SCODE, copied from them).
generated Bnk1uacService.java:
  Storage cw17 = Cobol.commarea(f429_DFHCOMMAREA, 107);
  InqaccDfhcommarea ca16 = out_InqaccDfhcommarea(cw17, 0);
  String lr15 = task.link("INQACC".strip(), ca16, 107, cw17.bytes);
  if ("NORMAL".equals(lr15)) { in_InqaccDfhcommarea(ca16, cw17, 0); Cobol.commareaBack(cw17, f429_DFHCOMMAREA); }
java side, INQACC's RETURN: "inqaccCustno": -16, "inqaccScode": -16

Expected. After a LINK, the caller's storage holds exactly the bytes the callee left in the COMMAREA (IBM: the COMMAREA is passed by address, so the callee changes the caller's storage in place). A byte the callee did not write must not change. The callee's port already takes the bytes (task.linkArea(), #4765). So the write-back should be those bytes, not a DTO round trip, or the DTO round trip must keep bytes it cannot decode. Never loosen the comparison: the case shows it as a COMMAREA difference.

Repro. The scratch generator for the case is in the #4270 CBSA cases handoff (handoff-4270-cbsa-whole-cases.md). Its scenario inquire-not-found (ENTER with ACCNO 00000050) is enough.

Blocks: an equivalence case for CBSA BNK1UAC. BNK1UAC is also blocked by #4695 (RETURN LENGTH(99) over its DTO). Part of #4270.

Activity

  1. added
    bug
    legacy-modernization
    on Oct 9, 2026
  2. 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

    bugera:2legacy-modernizationpriority: mediumscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions