Skip to content

CBSA Db2: INQACC, DELACC, XFRFUN, CUSTCTRL proven; backout honours CSD RECOVERY on both sides - #4156

Merged
squid-protocol merged 5 commits into
mainfrom
feat/db2-cbsa-programs
Oct 2, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
feat/db2-cbsa-programs

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What

Four more CBSA Db2 programs are translated with no model and proven on real IBM Db2, bringing CBSA to 6 of 12:

case program scenarios paragraphs branches statements
cbsa-inqacc INQACC, inquire account (cursor; ABNDPROC in the task) 14 22/25 13/25 240/240
cbsa-delacc DELACC, delete account + PROCTRAN 11 19/19 10/14 134/134
cbsa-xfrfun XFRFUN, transfer funds (all four SYNCPOINT ROLLBACK paths) 22 27/28 44/81 439/439
cbsa-custctrl CUSTCTRL, customer control record 6 7/7 3/4 21/21

Subagents drafted the scenarios and the proofs checked them. The subagents also found most of the bugs below; told to stop rather than work around, each stop was a real gap.

Backout, on both sides (register X3)

  • COBOL model: it backed out every file. A case may now state a dataset's CSD RECOVERY(NONE), with a recovery_why citing the CSD. CBSA's ABNDFILE, the abend log, is not backed out.
  • Java side: an abend that terminates the task now backs out the unit of work. Before, it only did so on SYNCPOINT ROLLBACK. Changes to a RECOVERY(NONE) file are made outside the transaction (REQUIRES_NEW) through CicsTask.write.

Translator and harness

  • COMMAREA via COPY REPLACING: a COMMAREA declared by COPY … REPLACING … BY DFHCOMMAREA is detected.
  • POINTER fields in a COMMAREA DTO:
    • NULL travels; an address stops the run by name.
    • A DTO with data after a POINTER is refused, because GnuCOBOL's pointer is 8 bytes and IBM's is 4 (new register entry C9).
    • When a program's own COMMAREA can't be carried, the task now stops by name rather than running as if it had none.
  • INITIALIZE sets a POINTER to NULL, as GnuCOBOL does (measured).
  • ENQ / DEQ / DELAY on both sides: one task in the region, so NORMAL; a DELAY takes no time (X4).
  • SQLDA stand-in: a declaration-only stand-in for EXEC SQL INCLUDE SQLDA; dynamic SQL is still refused. This lets XFRFUN translate.
  • FORMATTIME: DATESEP / TIMESEP given with no value now mean IBM's / and : in the det port.
  • Comparison fixes:
    • a LINKed program's RETURN carries no COMMAREA of its own;
    • a COMMAREA's FILLERs are not compared;
    • ggsqlrun dumps a value by its length (a CHAR holding X'00' was cut off at the NUL).

Re-proven

Not reachable here

  • INQACCCU, DELCUS, CREACC: their COMMAREAs have data after a POINTER (C9).
  • ACCTCTRL: only CBSA's Java front end calls it.
  • CRECUST: needs IBM's CEEIGZCT copybook.
  • BANKDATA: FUNCTION RANDOM.

Tests

  • pr_gates.py --fast: 5/5 pass.
  • Full suite: 13,473 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ

squid-protocol and others added 5 commits October 2, 2026 13:33
… both sides and an abend backs out

- cbsa-inqacc (14 scenarios, ABNDPROC in the task) and cbsa-delacc (11): scenarios drafted by a subagent, checked by
  the proofs; the subagent found the first three bugs below.
- A COMMAREA declared by COPY ... REPLACING ... BY DFHCOMMAREA (CBSA) is the program's COMMAREA on the COBOL side.
- A POINTER in a COMMAREA DTO: NULL travels (all zero bytes), an address stops by name; a DTO with data after a
  POINTER is refused (GnuCOBOL's pointer is 8 bytes, IBM's 4: register C9).
- ggsqlrun dumps a value by its length: a CHAR holding X'00' was cut at its first NUL.
- FORMATTIME DATESEP / TIMESEP with no value: IBM's '/' and ':' in the det port (it wrote none).
- A LINKed program's RETURN carries no COMMAREA of its own: the COBOL side had read the last RETURN for every one.
- Backout (register X3): a case's RECOVERY(NONE) dataset (CBSA's ABNDFILE, from BANK.csd) is not backed out by the
  COBOL model, and its changes are made outside the Java task's transaction; an abend that terminates the task now
  backs out the Java side's unit of work too (it had only on SYNCPOINT ROLLBACK).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…XFRFUN, CUSTCTRL, INQACCCU translate whole

- ENQ / DEQ / DELAY on both sides: one task in the region, so NORMAL; a task takes no time, a DELAY included (X4).
  DELAY REQID and other options are refused by name.
- INITIALIZE sets a POINTER NULL (GnuCOBOL, measured); a port's pointer only ever holds NULL.
- SQLDA: IBM's COBOL declaration as a stand-in for EXEC SQL INCLUDE SQLDA (declared only; dynamic SQL is refused).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…ops by name; FILLER not compared

- cbsa-xfrfun: transfers both ways, no funds check, the amount rule, boundaries and overflow, same account, not-found
  on either side with all four SYNCPOINT ROLLBACK paths backing out the other UPDATE, NULL dates; ABNDPROC in the task.
  Scenarios drafted by a subagent, checked by the proof (it found a real CBSA misplaced END-IF, matched on both sides).
- cbsa-custctrl: the control record, NOTFND / IOERR / NOTOPEN / DISABLED faults.
- A program whose own COMMAREA DTO cannot be carried (INQACCCU: data after a POINTER, C9) now stops by name when the
  task gets one; it had run as if there were no COMMAREA.
- A COMMAREA's FILLERs are not compared (no DTO property holds them; several shared one key).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 84a6614 into main Oct 2, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the feat/db2-cbsa-programs branch October 2, 2026 18:09
@squid-protocol

Copy link
Copy Markdown
Owner Author

Re-proof on the rebased branch (caa8b850, with #4140's TRUNC(STD)): det_port.py run --all-cases gives 48 proven. The two not proven are the known carddemo-cardupdate (#4085) and carddemo-intcalc-generated (register D1), the same as before this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant