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: 8057
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
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
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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