I have already raised doubts in Cobol forum for calling Cobol from C this question is also related to that..
Am trying to invoke Cobol from C. Now i have my JCL ready but am getting SOC4 abend . these are my steps :
1. Compile C module ( main module) -> using EDCCLIB
2. Compile Cobol module -> using IGYWC
3. Prelink C object -> using EDCPRLK
4. Prelink Cobol object -> using EDCPRLK
5. Link edit both PLKED.SYLMOD -> using HEWL
Am not sure whether i can include both prelink syslmod in one link edit statement. Please let me know if am missing any steps or if the order of compilation is wrong. Please advise.
Joined: 06 Jun 2008 Posts: 8214 Location: Dubuque, Iowa, USA
Sriram: I've got a working example of a C program calling a COBOL program that runs with a normal 0000 return code -- no abend of any type. If you're getting a S0C4 abend, it's because your code is not working -- C programs can call COBOL programs without any problems.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
You need to talk with the people who support the compilers and link editor for your system. They should be able to ensure you have the correct jcl and optons for your environment.
Either you have a problem in your code or you have a problem in the linkedit. You may want to write a cobol "stub" that will call the submodule and make sure you can successfully call from cobol to cobol. . .
Something you may want to check is if the C program is calling the cobol module statically or dynamically and make sure your libraries are defined properly for the linkedit. Again, your system support people should best know what is correct for your environmant.