Chapter 26 Key Takeaways

  1. No language is an island. Modern enterprise systems are polyglot. COBOL excels at business logic and decimal arithmetic; C provides system utilities and portable libraries; Java enables web interfaces; assembler delivers maximum performance. Inter-language communication lets each language contribute its strengths.

  2. The binary interface pattern is the golden rule. All cross-language parameters should use COMP (binary) data types. No COMP-3, no DISPLAY numeric, no packed decimal crosses a language boundary. COBOL converts internally.

  3. BY REFERENCE vs. BY VALUE is the most critical distinction. COBOL defaults to BY REFERENCE (passes address). C scalars default to by-value. Mismatch causes silent data corruption. Be explicit in every CALL.

  4. String handling requires explicit conversion. COBOL strings are fixed-length, space-padded, not null-terminated. C strings are variable-length and null-terminated. Build reusable conversion utilities and use them consistently.

  5. The three-layer Java integration (Java → C JNI glue → COBOL) is the standard architecture for Java-COBOL interoperability on z/OS. Each layer handles type conversion appropriate to its role.

  6. SPECIAL-NAMES provides CALL-CONVENTION (for specifying calling conventions), ALPHABET (for character encoding), and CURRENCY SIGN — all relevant to inter-language and international data exchange.

  7. Design COBOL programs for external callers by using COMP parameters, GOBACK (not STOP RUN), and documenting the interface contract. A COBOL program called from C that uses STOP RUN will terminate the entire runtime.

  8. The wrapper pattern isolates calling programs from the inter-language interface. When the underlying implementation changes (different C library version, switch from C to Java), only the wrapper changes.

  9. Test at every boundary — language boundaries, data type boundaries, encoding boundaries, and edge-case boundaries. The most insidious inter-language bugs involve correct code on both sides with an incorrect interface between them.

  10. Document every interface with a standard specification: parameter types on both sides, valid ranges, error codes, encoding expectations, compiler requirements, and library versions.

  11. Mixed-language debugging is hard. Trace logging at every language boundary is the most effective strategy. Prevention (clear interface contracts, boundary testing) is better than diagnosis.

  12. The human factor is decisive. Inter-language systems require cross-team communication. Monthly code reviews where each team explains their side of the interface to the others prevent the misunderstandings that cause interface bugs.