Skip to content

CICS: DEFINE COUNTER, DELETE COUNTER; GET COUNTER of a missing counter is INVREQ RESP2 201 (Part of #4270) - #4762

Merged
squid-protocol merged 3 commits into
mainfrom
feat/4270-named-counters
Oct 9, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
feat/4270-named-counters

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4270.

What

Register X30 in oracle_assumptions.md (IBM's pages cited there). Chosen by programs made whole (cics_census.py blockers, baseline origin/main 82918f0, 111/179 whole).

  • DEFINE COUNTER (COUNTER / POOL / VALUE): the counter is created with VALUE, or "an initial value of zero" when it is omitted (IBM); a counter of that name and pool that exists is INVREQ RESP2 202 "Duplicate counter name" (IBM's page lists no DUPREC); a pool or counter name outside IBM's characters is INVREQ RESP2 403 / 404. No POOL is 8 blanks, a different pool from HCPOOL.
  • DELETE COUNTER: removes it; a counter that is not there is INVREQ RESP2 201 "Named counter not found" (IBM lists no NOTFND); a bad pool 403 (the page lists no 404).
  • Bug (GET COUNTER): a missing counter answered NOTFND (RESP 13). IBM's GET COUNTER page lists INVREQ RESP2 201 and no NOTFND. Fixed in both runtimes (CicsTask.getCounter now returns {RESP, RESP2, value}; the det translator writes both; the stub's GGCGCNT); GET and QUERY COUNTER also answer 403 / 404 for a pool / name outside IBM's characters. GET COUNTER now accepts RESP2.
  • Refused by name (what IBM leaves open): MINIMUM / MAXIMUM (the defaults are "low-values" / "high values"; IBM does not say how they read signed), NOSUSPEND (BUSY needs a coupling facility), DCOUNTER (unsigned doublewords); at run time on both runtimes a VALUE below zero (406 depends on the unstated minimum) and a counter name of blanks only.
  • The stub's GET-COUNTER event line is gone (the Java side never had one; the crucible converter rejects it).

GET COUNTER fix: impact on proven cases

No verdict moved. The only committed cases that run GET COUNTER are the equivalence cases genapp-lgacdb01 and genapp-lgacus01 (scenario add-without-counter): LGACDB01 tests WS-RESP Not = DFHRESP(NORMAL), so NOTFND and INVREQ take the same branch. Their why text said "(NOTFND)"; corrected per IBM. det_port.py check vs origin/main: 77/79 ports unchanged, those two changed (the GET COUNTER codegen) and det_port.py run genapp-lgacdb01 genapp-lgacus01 re-proves both (PROVED, 151/151 and 185/185 statements). No cics-crucible case, committed port or other equivalence case used GET COUNTER.

Proof

New cics-crucible case condition-handling/hc-named-counters (companion below; 2 scenarios, 24 breadcrumbs, traced by hand from IBM's four counter pages, check-hand-derived OK, validate.py 24/24, no SPEC change: the case defines its own counters): cobol-stub 2/2 and java-ported (det port HCCNTR 90/90 statements, 0 holes) 2/2, with --unpinned; a mutated log (L1 R=13) fails both sides. Unit tests: translator, spec entries, harness, CicsTask and the stub C (compiled), including the 403 / 404 rules and the refusals. pr_gates --ratchets 7/7 (against a v0.6.0 checkout), --fast 5/5.

Census (before -> after, translation only, burned + census corpora, baseline 82918f0)

  • Programs translated whole: 111 -> 112 of 179 (non-burned 12 -> 12). Made whole: lgsetup (GenApp, 17/91 -> 91/91 statements, 0 holes).
  • Programs using DEFINE / DELETE / GET: whole 20 -> 21; holes naming those verbs 10 -> 8 (left: zECS's GET DCOUNTER, refused by name).
  • Next blockers (programs whose only gap): LayoutError fixed-form literal past column (8, non-burned), missing copybook BOOKFUNC (7), BAQRINFO (2), CMQGMOV (2), ISPF screens (2), InqacccuDfhcommarea: data after a POINTER (2, CBSA), <name>: undeclared item (1 / 4 touched).

Cross-repo

Companion: squid-protocol/cics-crucible#16 (the case). Merge it first; this PR's CI cics-crucible job does not see the case until a release + pin bump (not done here: no tag, the pin untouched).

🤖 Generated with Claude Code

https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D

squid-protocol and others added 2 commits October 9, 2026 03:12
…r is INVREQ RESP2 201, not NOTFND (Part of #4270)

DEFINE COUNTER (VALUE, initial zero, INVREQ RESP2 202 for a duplicate, 403 / 404
for names outside IBM's characters) and DELETE COUNTER (INVREQ RESP2 201) in
both runtimes (CicsTask / DetCics and the stub's GGCDCNT / GGCXCNT). GET and
QUERY COUNTER answer INVREQ RESP2 201 for a counter that is not there, where GET
answered NOTFND; IBM lists none. What IBM leaves open is refused by name
(register X30).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging labels Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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

Labels

bug Unintended behavior or logic failure in the engine enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant