Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.
cobinit
Initializes the COBOL environment, so that a COBOL program can be called from a non-COBOL
program.
Restriction: This function is supported for native COBOL only.
Syntax:
#include "cobmain.h" int cobinit (void);
Parameters:
None.
Equivalent COBOL Syntax:
None.
Example:
The following example shows how to initialize (and close down) the COBOL environment from a C main(), so that a COBOL program can be called:
main(int argv, char *argv)
{
cobinit(); /* Initialize COBOL environment */
cobcall("cobep", 0, NULL); /* Call a COBOL program */
cobtidy(); /* Close down COBOL environment */
return(0);
)
Comments:
You must call cobinit() before calling a COBOL program if the main program is not written in COBOL.
If you do not, you might receive an initialization error when you enter your COBOL code.
On some platforms, the COBOL environment is initialized when the COBOL run-time system is loaded (for example, at process startup).
If the COBOL environment has already been initialized then cobinit() returns successfully.
This function returns 0 on success.