Handling function returns between C and COBOL

In COBOL, values can be returned to COBOL programs as COBOL returning variables from C functions using standard C function returns. This is the recommended approach for passing modified values back from a C function to a COBOL program.

Note: When a COBOL program calls a void C function, the RETURN-CODE special register contents will be unpredictable upon return from the call.

The following examples illustrate how to declare data types for using function returns in C to COBOL applications.