You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Globe: EBCDIC Collation Inverts ASCII/Java Business Logic (1 vs A) #3986
EBCDIC and ASCII (Java) have fundamentally inverted sorting rules for alphanumeric characters:
EBCDIC Collation: Letters > Numbers (e.g., A is 0xC1, 0 is 0xF0) -> 0 > A evaluates to TRUE.
ASCII Collation: Numbers < Letters (e.g., A is 0x41, 0 is 0x30) -> 0 > A evaluates to FALSE.
The Impact
If a COBOL program contains business logic like IF CUSTOMER-ID > 'A' (perhaps to check if an ID starts with a letter instead of a number), translating this directly into Java as if (customerId.compareTo(A) > 0) will yield the exact opposite boolean result. This silently corrupts the execution path of the application.
Required Action
While PR #3822 beautifully handled database sorting (codePageSortKey), we need a runtime utility for standard conditional logic. The Java generator must translate alphanumeric COBOL >, <, >=, and <= operators into a wrapper method like CobolCompare.ebcdic(val1, val2) rather than using native Java .compareTo(), ensuring runtime business logic perfectly matches the mainframe.
Activity
#3986: bless the full-corpus refraction snapshots (util/CobolCompare)