View previous topic :: View next topic
|
Author |
Message |
sedireswarapu
New User
Joined: 18 Jun 2008 Posts: 28 Location: India
|
|
|
|
Hi
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.
Code: |
//LKED EXEC PGM=HEWL,
// REGION=5000K,
// PARM='LIST,MAP,RENT,XREF'
//SYSLIN DD DSN=*.PLKED1.SYSMOD,DISP=(OLD,DELETE)
// DD DSN=*.PLKED2.SYSMOD,DISP=(OLD,DELETE) |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 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. |
|
Back to top |
|
|
sedireswarapu
New User
Joined: 18 Jun 2008 Posts: 28 Location: India
|
|
|
|
Nice to hear that it works.
How did you compile your modules and prelink and link ?
It would be great if you provide me those steps?
I will work on it and post the results.If you need further info from me let me know. As i have been working on this for 2 weeks of time for solving this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
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. |
|
Back to top |
|
|
|