Convert COBOL merge_sort_test.cbl to Java - MBA-18 #21
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.
Convert COBOL merge_sort_test.cbl to Java - MBA-18
Summary
This PR converts the COBOL program
merge_sort/merge_sort_test.cblto a functionally equivalent Java programMergeSortExample.javafor ticket MBA-18. The conversion preserves the exact three-step workflow:Key implementation details:
CustomerRecordclass with 5-digit customer ID, 50-char names, 5-digit contract ID, 25-char commentReview & Testing Checklist for Human
createTestData()with the original COBOL source (lines 185-334) to ensure no transcription errorstest-file-1.txt,test-file-2.txt,work-temp.txt,merge-output.txt,sorted-contract-id.txt) with proper contentRecommended test plan: If possible, compile and run the original COBOL program and compare its console output and generated files with the Java version to verify functional equivalence.
Diagram
%%{ init : { "theme" : "default" }}%% graph TD COBOL["merge_sort_test.cbl<br/>(Original COBOL)"]:::context Java["MergeSortExample.java<br/>(New Java conversion)"]:::major-edit TestFile1["test-file-1.txt<br/>(6 customer records)"]:::context TestFile2["test-file-2.txt<br/>(5 customer records)"]:::context MergeOutput["merge-output.txt<br/>(11 records, sorted by customer ID)"]:::context SortedOutput["sorted-contract-id.txt<br/>(11 records, sorted by contract ID desc)"]:::context COBOL -->|"converted to"| Java Java -->|"creates"| TestFile1 Java -->|"creates"| TestFile2 Java -->|"merges & sorts"| MergeOutput Java -->|"sorts by contract ID"| SortedOutput subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes