Repository navigation
CBL / PROCESS compiler options and the DB2 DATE/TIME format (#3828) - #3887
Merged
Merged
Conversation
A Western European shop may compile with INTDATE(LILIAN) and run DB2 with DATE format EUR. Neither was read. - Engine: new per-file fact `compiler_options` (core/compiler_options.py -> compiler_options_data): each CBL / PROCESS card option with its full name (AR -> ARITH, YW -> YEARWINDOW ...), its parenthesised value and the option as written, read only where the compiler reads a card (the leading block, or after END PROGRAM). Wired through galaxyscope, record_keeper, the delta-scan rehydrator, galaxy_ir (EngineFile.compiler_options / compiler_option()), the audit JSON and the LLM brief (semantic options only). - Java: culture.db2_date_format now drives a generated Db2Dates beside the DB2 repositories (EUR dd.mm.yyyy / hh.mm.ss, USA mm/dd/yyyy / hh:mm AM, ISO, JIS; TIMESTAMP yyyy-mm-dd-hh.mm.ss.nnnnnn; parsing accepts every DB2 input form; LOCAL refuses until the exit's patterns are set). Repositories name the DATE/TIME columns that need it. TODO(#3828) removed. - Port tickets: two porting rules (DB2 character dates; INTDATE day zero), the program's compiler_options, and a rule per non-default semantic option (INTDATE(LILIAN), TRUNC(BIN|OPT), ARITH(EXTEND), NUMPROC(PFD)). - Harness: the program's cards (blanked: GnuCOBOL rejects CBL) and a case's `compiler_options` become cobc flags (TRUNC(BIN) -> -fnotrunc); options GnuCOBOL 3.1 cannot honour (INTDATE(LILIAN), ARITH(EXTEND), NUMPROC(PFD), TRUNC(OPT)) stop the run instead of passing unfaithfully. A case's `culture` reaches the Java side's config. Defaults unchanged. Golden masters: one new compiler_options.json per mode, 43 crucible programs with CBL / PROCESS cards; nothing else moves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3828 (epic #3819, the Western Europe region).
A German, Nordic or French shop may compile with
INTDATE(LILIAN)and run DB2 with DATE format EUR. Neither was read:FUNCTION INTEGER-OF-DATEcounts from 1601-01-01 (ANSI) or from 1582-10-15 (LILIAN), and a DB2 DATE fetched into aPIC X(10)on an EUR subsystem reads26.09.2026, but the Java assumed ISO.What changed
compiler_options(core/compiler_options.py->compiler_options_data), wired the same way Currency signs in PICTURE: £ € ¥ and CURRENCY SIGN / PICTURE SYMBOL mis-size or drop fields; the answer key shares the blind spot #3820 wired SPECIAL-NAMES: galaxyscope, record_keeper, the delta-scan rehydrator, galaxy_ir (EngineFile.compiler_options,EngineFile.compiler_option(name)), the audit JSON, the LLM brief (semantic options only) and the fact-channel guide.AR(E)-> ARITH EXTEND,YW-> YEARWINDOW,NOCURR-> NOCURRENCY);'SP,EDF'stays whole);PERFORM/PROCESS THRU ...is not a card. Columns 73-80 are ignored.culture.db2_date_formatis now wired (the TODO is removed). A generatedrepository/db2/Db2Datessits beside the DB2 repositories.dd.mm.yyyy/hh.mm.ss, USAmm/dd/yyyy/hh:mm AM, ISOyyyy-mm-dd/hh.mm.ss, JISyyyy-mm-dd/hh:mm:ss. A TIMESTAMP is alwaysyyyy-mm-dd-hh.mm.ss.nnnnnn.port_runnershowsDb2Datesto the agent.PORTING_RULES: DB2 character dates viaDb2Dates, and the INTDATE day zero (1600-12-31 ANSI vs 1582-10-14 LILIAN, 6653 days apart).compiler_optionsfield (JSON and a Markdown table) carrying the program's cards.INTDATE(LILIAN),TRUNC(BIN|OPT),ARITH(EXTEND),NUMPROC(PFD)."compiler_options": ["TRUNC(BIN)"]become cobc flags, on both the batch and the CICS side. The case's list stands for the compile step's PARM, so the program's cards override it, as on z/OS.CBLwith an error and ignoresPROCESS."culture"(e.g.{"db2_date_format": "eur"}) reaches the Java side's generated config.Not done, and why
cobc --helpin the harness image, GnuCOBOL 3.1.2: its INTEGER-OF-DATE is always ANSI (the probe returns 155497 for 2026-09-26). It also has no ARITH(EXTEND), NUMPROC or TRUNC(OPT) switch. A case needing any of these now fails withUnsupportedOptioninstead of passing unfaithfully. OnlyTRUNC(BIN)has an equivalent (-fnotrunc, verified in an E2E test: aPIC S9(4) COMPholds 10000). The LILIAN behaviour is covered by the porting rule and a unit test of the day arithmetic, not by the harness.DateStyle, marked "plausible" in the issue: not probed.Golden masters and snapshots
compiler_options.jsonper mode, identical in both. It holds 43 crucible programs with CBL / PROCESS cards: CICS / SQL / NODYNAM / NSYMBOL(NATIONAL) / TRUNC(STD) in CBSA, GenApp and zECS, and CODEPAGE(1140) / XMLPARSE in che4z. Nothing else moves.updateand nothing moved: they do not include the DB2 repositories or the tickets.Gates
tests/tools/pr_gates.py --e2e: lint, audits, secrets, xray, gauntlet, golden and the suite (784s, withEQUIVALENCE_E2E=1) all PASS. The full run hit my 10-minute foreground limit, so the suite gate ran on its own.java_target_matrix.py --scan --only default mysqlon a DB2 estate withCBL INTDATE(LILIAN): PASS. The generatedDb2Datesis also compiled and run with JDK 17 for all five formats intests/cobol_mainframe/test_regional_options.py.🤖 Generated with Claude Code