IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Steps for compile C and Cobol ..where C invokes Cobol


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Wed Oct 01, 2008 7:20 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 01, 2008 7:25 pm
Reply with quote

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
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Wed Oct 01, 2008 8:33 pm
Reply with quote

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. icon_confused.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 01, 2008 10:05 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top