Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Steps for compile C and Cobol ..where C invokes Cobol
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: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Wed Oct 01, 2008 7:25 pm    Post subject:
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    Post subject: Reply to: Steps for compile C and Cobol ..where C invokes Co
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

Site Director


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

PostPosted: Wed Oct 01, 2008 10:05 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us