Skip to content

MBA-18: Convert merge_sort_test.cbl to Java#83

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777663680-mba18-merge-sort-java
Open

MBA-18: Convert merge_sort_test.cbl to Java#83
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777663680-mba18-merge-sort-java

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 1, 2026

Summary

Converts merge_sort_test.cbl to an equivalent Java program (MergeSortTest.java) that faithfully replicates the COBOL version's behavior:

  • Fixed-width records: 135-char records matching COBOL's PIC clauses (zero-padded numerics, space-padded alphanumerics)
  • File-based I/O: Reads/writes the same files (test-file-1.txt, test-file-2.txt, merge-output.txt, sorted-contract-id.txt)
  • Merge: Combines both input files sorted ascending by customer-id (replicates COBOL MERGE ... ON ASCENDING KEY)
  • Sort: Re-sorts merged output descending by contract-id (replicates COBOL SORT ... ON DESCENDING KEY)
  • Output fidelity: Produces identical console output and file contents as the COBOL program

Jira: MBA-18

Review & Testing Checklist for Human

  • Compile and run MergeSortTest.java — verify output matches COBOL program's output
  • Check that generated files (merge-output.txt, sorted-contract-id.txt) have correct 135-char fixed-width records
  • Verify merge order (ascending customer-id) and sort order (descending contract-id)

Notes

  • No external dependencies — uses only java.io and java.util from the JDK
  • Record layout documented in the file header comment for traceability back to COBOL PIC clauses
  • The program structure mirrors the COBOL paragraph-to-method mapping: main-proceduremain(), create-test-datacreateTestData(), etc.

Link to Devin session: https://app.devin.ai/sessions/f737c11b93da4d5fba8eb41f9c833e7c


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

Add MergeSortTest.java that faithfully replicates the COBOL merge sort
program's behavior:
- Fixed-width 135-char record format (PIC 9/X padding)
- File-based I/O with test-file-1.txt, test-file-2.txt
- Merge of both files sorted ascending by customer-id
- Sort of merged file descending by contract-id
- Same console output and file output as COBOL version
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants