Migrate CBSTM03A/CBSTM03B statement generation to Java - #187
Open
devanshi-gpta wants to merge 1 commit into
Open
devanshi-gpta wants to merge 1 commit into
devanshi-gpta wants to merge 1 commit into
Conversation
Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Migrates
CBSTM03A(statement driver, replacingCREASTMT.JCL) and itsCBSTM03BI/O subroutine intocom.carddemo.batch.statement. No files outside that package (plus the README mapping table) are touched.The whole point of this migration is byte-level fidelity of the two outputs, so the COBOL record layouts are reproduced field by field rather than re-expressed as templates:
StatementService.render(...)emitsList<String>records padded to the DDLRECL(STMTFILE 80, HTMLFILE 100), in the exact write order of the COBOL paragraphs (5000-CREATE-STATEMENT→5100/5200HTML header →6000-WRITE-TRANSper transaction →4000-TRNXFILE-GETtotals/footer). The HTML88-level literals are transcribed verbatim, including their continuation lines.StatementFormatterimplements the COBOL data movements the layout depends on, which are the easy things to get subtly wrong:PIC 9(9).99-(ST-CURR-BAL) →1234.56renders as"000001234.56 ",-42.07as"000000042.07-"; integer digits beyond nine are truncated high-order, asMOVEdoes.PIC Z(9).99-(ST-TRANAMT / ST-TOTAL-TRAMT) →0.75renders as" .75 ".MOVE ACCT-ID PIC 9(11) TO PIC X(20)→"00000000011" + 9 spaces.STRING ... DELIMITED BY ' '/' '(the name and address-line-3 builds, and theDELIMITED BY ' 'HTML variants) transfer only the part of the fixed-width sending field before the delimiter.StatementTransactionTablereplaces theWS-TRNX-TABLEtwo-dimensional table:TRNXFILEis read once inTRAN-CARD-NUM + TRAN-IDorder (the sort CREASTMT.JCL STEP010 performs) and grouped per card, and the per-statement scan stops at the first stored card sorting afterXREF-CARD-NUM, exactly like4000-TRNXFILE-GET. TheOCCURS 51/OCCURS 10bounds are kept as constants; records past them are dropped with a warning instead of overwriting adjacent storage the way the COBOL would.StatementFileServiceis theCBSTM03Bstand-in over the repositories (sequential XREFFILE/TRNXFILE, keyed CUSTFILE/ACCTFILE). It does not reproduce the literalCALLinterface, but it keeps the status semantics: a missing keyed record raisesStatementFileException("CUSTFILE", "23"), mirroring9999-ABEND-PROGRAM.StatementJobConfigwraps the service in a Spring Batch jobcreastmtJobwriting tocarddemo.statement.text-file/carddemo.statement.html-file.No new dependencies;
pom.xmlunchanged.Testing
cd java && mvn -B clean verifypasses (25 tests). New: layout assertions for every header line, transaction line and theTotal EXP:line; HTML order/content; the numeric-edit pictures; table grouping and OCCURS limits; and a@SpringBootTestgenerating statements for a seededcardxref/custdata/acctdataaccount with two transactions (250.00,-100.50→ total149.50).Link to Devin session: https://app.devin.ai/sessions/3485785cb7574e7e8391ead52ee9ee82
Requested by: @devanshi-gpta
Devin Review