Skip to main content

[Migrated content. Thread originally posted on 03 February 2012]

Hello,

I know how to link a C library in a COBOL program (static link), but I do not know if it is possible to make it dinamically.

To build the static link I do:

cob -z,CC PRCALLC SFDC.c SFDCPP.cpp

To build the C library alone:

cob -z,CC SFDC.c SFDCPP.cpp

But, how to call the C module from a COBOL program which is not linked with it?

Regards

[Migrated content. Thread originally posted on 03 February 2012]

Hello,

I know how to link a C library in a COBOL program (static link), but I do not know if it is possible to make it dinamically.

To build the static link I do:

cob -z,CC PRCALLC SFDC.c SFDCPP.cpp

To build the C library alone:

cob -z,CC SFDC.c SFDCPP.cpp

But, how to call the C module from a COBOL program which is not linked with it?

Regards
There's a few options but if the program isn't linked to the executable, you can load the library at runtime and call the program dynamically.

01 pp usage procedure-pointer.
...

*> load the module
set pp to entry "mylib"

*> entrypoints should now be visible
call "routine" using ...