Start of change

Using function prototypes

Function prototypes enable you to invoke COBOL user-defined functions in the following ways.

Start of change
  • Enable you to invoke COBOL user-defined functions or non-COBOL external functions such as C functions using the FUNCTION keyword.
  • Start of changeEnable you to invoke user-defined functions whose definitions are written in other files such as compilation groups.End of change
  • Enable you to invoke user-defined functions with a linkage interface (such as STATIC, DYNAMIC, or DLL) that was specified on the prototype using the ENTRY-INTERFACE phrase of the FUNCTION-ID paragraph.
End of change

The function prototype definition is a stand-alone compilation unit that, when compiled, produces no object code but rather informs the compiler about a function prototype. When the compiler subsequently encounters an invocation to the function, the compiler is able to perform conformance checking as well as generate the correct calling code for the specified linkage interface. Function prototype definitions must appear within the compilation group before any invocations to the function. Therefore it is recommended that all function prototypes appear first, before program and user-defined function definitions.

End of change