The BINARY-CHAR data type in COBOL represents a specialized numeric format designed for seamless interoperability with C programming language applications, specifically matching the size and characteristics of C's char data type.
BINARY-CHAR matches the C language's 'char' data type, typically 8 bits (1 byte). This ensures perfect data compatibility when interfacing with C functions.
123456789DATA DIVISION. WORKING-STORAGE SECTION. 01 STATUS-FLAGS. 05 ERROR-CODE USAGE BINARY-CHAR. 05 OPERATION-MODE USAGE BINARY-CHAR. PROCEDURE DIVISION. MOVE 0 TO ERROR-CODE. CALL "c_function" USING BY VALUE ERROR-CODE.