Passing data by value (indirect) between C and COBOL
Copies of variables can be passed between C and COBOL routines. On return, the actual value of the variables remains unchanged regardless of how it may have been modified in the called routine.
Value arguments can be passed BY CONTENT from COBOL programs and
received as C function parameters when declared with the appropriate
base type. Conversely, C function arguments can be passed by value
from C functions and received as COBOL parameters. The C compiler
generates the appropriate addressing code required to access the parameter
values; you can write your C function, which interoperates with COBOL,
as if it were in a C-only environment. It can be moved to a C-only
environment simply by removing the #pragma linkage directive.
For example, if a C function called FROMCOB is to receive a parameter
passed BY CONTENT of type int, the function prototype declaration
would look like this:
void FROMCOB(int)
Table 1 shows the supported data types for passing by value (indirect).