COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  Cobol load modules from C code functions

    Posted Tue April 02, 2024 11:10 AM

    Good day,

    I have following scenarion:

    C code with functions

    • func1.c - independent
    • func2.c - independent
    • func3.c - calls func1 & func2

    How I can compile and create separate load modules for Cobol above C code ?
    I need single module per single C code file.
    C code file includes only one fuinction

    Regards,

    Piotr



    ------------------------------
    Piotr Synowiec
    ------------------------------


  • 2.  RE: Cobol load modules from C code functions

    Posted Mon April 08, 2024 11:25 AM

    Hello,

    Assuming the scenario being on z/OS I think you should take a look at Communicating between C and COBOL.

    Otherwise, on IBM COBOL for Linux on x86 I think you should look at COBOL program calling C functions.

    Regards.



    ------------------------------
    Carlos A.
    None
    ------------------------------



  • 3.  RE: Cobol load modules from C code functions

    Posted Fri April 12, 2024 06:18 AM

    I do not have a problem with neither of these things.

    I have lib compiled into DLL with all the routines, which I have over 1000 in single C files.

    I'm looking for a way to create Cobol load modules from those routines in C files



    ------------------------------
    Piotr Synowiec
    ------------------------------



  • 4.  RE: Cobol load modules from C code functions

    Posted Mon April 15, 2024 06:55 AM

    Hi Piotr,

    People are I believe having difficulty understanding what you're asking. There is no such thing as a COBOL load module, there are only load modules containing COBOL, C, etc code. When it comes to your C code, it's not clear if you have a DLL containing all 1000 C functions, or an archive library containing the compiled C code, and you have a COBOL that will call the DLL or you want to statically bind the C code into that COBOL code.

    Bernie



    ------------------------------
    Bernie Rataj
    Technical Support Professional
    IBM Canada Ltd.
    Markham ON Canada

    https://www.ibm.com/products/cobol-compiler-zos
    https://www.ibm.com/products/pli-compiler-zos
    ------------------------------



  • 5.  RE: Cobol load modules from C code functions

    Posted Mon April 15, 2024 07:16 AM
    Edited by Piotr Synowiec Tue April 16, 2024 07:25 AM

    Hi Bernie,

    I have DLL that I built from all these C functions in separate C files and this solution works.

    I do not have a problem with calling functions from library using C nor Cobol.

    Now I'm looking for a way to create load modules for this functions from C code




    ------------------------------
    Piotr Synowiec
    ------------------------------