Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Calling COBOL from C - getting SOC1

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL
  View previous topic :: View next topic  
Author Message
balajiiinx
Member


Joined: 20 Sep 2008
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Sep 23, 2008 10:25 am    Post subject: Calling COBOL from C - getting SOC1 Reply with quote

Hi

I have been trying to invoke a Cobol program from C program. I was able to call Cobol from C program perfectly but my cobol source inturn does a STATIC call to external lib routine. There it actually abends, in many sites they say it as some library missing in link-edit step but am able to run the Cobol as a stand alone ( executes external lib routine also) but when i invoke the same Cobol from C it just abends with SOC1.


Find below the JCL snippet i used for compile, Prelink and Link-edit

//*---------------------------------------------------
//** COMPILE C MODULE
//*---------------------------------------------------
//CB2V EXEC EDCCLIB,
// INFILE='ABMWBG1.BITSP3.C(MVS2CSAM)',
// LIBPRFX='SYS1.LE',
// LNGPRFX='SYS1.IBMCPP',
// LIBRARY='ABMWBG1.BITSP3.OBJLIBZ',
// MEMBER='MVS2CSAM',
// CPARM='OPTFILE(DD:CCOPTS)',
// CPARM2='DEF(_XOPEN_SOURCE_EXTENDED)'
//CCOPTS DD DSN=ABMWBG1.BITSP3.JCLZ(CCOPTS1),DISP=SHR
//SYSLIB DD DSN=&LIBPRFX..SCEEH.SYS.H,DISP=SHR
// DD DSN=&LIBPRFX..SCEEH.H,DISP=SHR
// DD DSN=XMQS11.SCSQC370,DISP=SHR
// DD DSN=ABMWBG1.BITSP3.LOADLIB,DISP=SHR
//USERLIB DD DSN=XBMW01.BMWV5R0.H,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*---------------------------------------------------
//** PRE - LINK C MODULE
//*---------------------------------------------------
//PLKED EXEC PGM=EDCPRLK,
// REGION=5000K,
// PARM='MAP, NOER,NONCAL'
//STEPLIB DD DSN=SYS1.LE.SCEERUN,DISP=SHR
// DD DSN=SYS1.LE.SCEELKED,DISP=SHR
//SYSMSGS DD DSN=SYS1.LE.SCEEMSGP(EDCPMSGE),DISP=SHR
//SYSLIB DD DSN=SYS1.LE.SCEECPP,DISP=SHR
//SYSIN DD DSN=ABMWBG1.BITSP3.OBJLIBZ(MVS2CSAM),DISP=SHR
// DD DSN=XBMW01.BMWV5R0.IMPORTS(BMWDLLB),DISP=SHR
//SYSMOD DD DSN=&&PLKSET,DISP=(,PASS),
// UNIT=SYSDA,
// SPACE=(3200,(30,30)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)
//SYSDEFSD DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*---------------------------------------------------
//** COMPILE COBOL MODULE
//*---------------------------------------------------
//STEP1 EXEC IGYWCPL,PARM='OBJECT,XREF'
//SYSIN DD DSN=ABMWBG1.BITSP3.COBOL(BITSCOB),DISP=SHR
//STEPLIB DD DSN=SYS1.IGY.COBOL.V34.SIGYCOMP,DISP=SHR
//COBOL.SYSLIB DD DISP=SHR,DSN=PEDV01.PROD.COMMON.COPYLIB
//COBOL.SYSLIN DD DSN=ABMWBG1.BITSP3.OBJLIBZ(BITSCOB),DISP=SHR
//*---------------------------------------------------
//** PRE - LINK COBOL MODULE
//*---------------------------------------------------
//PLKED.SYSIN DD DSN=ABMWBG1.BITSP3.OBJLIBZ(BITSCOB),DISP=SHR
// DD DSN=XBMW01.BMWV5R0.IMPORTS(BMWDLLB),DISP=SHR
//* DD DSN=XBMW01.BMWPROD.OBJLIB(BMWBSTUB),DISP=SHR
//*---------------------------------------------------
//** LINK - EDIT C AND COBOL OBJECT
//*---------------------------------------------------
//*KED EXEC PGM=HEWL,PARM='
//* REGION=1024K
//LKED.SYSLMOD DD DSN=ABMWBG1.BITSP3.LOADLIB(MVSC2COB),DISP=SHR
//LKED.SYSLIB DD DSN=SYS1.LE.SCEELKED,DISP=SHR
// DD DISP=SHR,DSN=SYS1.LE.SCEERUN
// DD DSN=XMQS11.SCSQLOAD,DISP=SHR
// DD DSN=XBMW01.BMWPROD.OBJLIB,DISP=SHR
// DD DSN=ABMWBG1.BITSP3.OBJLIBZ,DISP=SHR
// DD DSN=XBMW01.BMWV5R0.IMPORTS,DISP=SHR
//SYSPRINT DD SYSOUT=*
//LKED.SYSLIN DD DSN=*.PLKED.SYSMOD,DISP=(OLD,DELETE)
// DD DSN=ABMWBG1.BITSP3.OBJLIBZ(BITSCOB),DISP=SHR
// DD DDNAME=SYSIN
//LKED.SYSIN DD *
INCLUDE SYSLIB(CEEROOTB)
INCLUDE SYSLIB(CSQBSTUB)
INCLUDE SYSLIB(BMWBSTUB) --> EXTERNAL METHOD STUB
INCLUDE SYSLIB(EDCSTART)
INCLUDE SYSLIB(@@CBL2C)
INCLUDE SYSLIB(BITSCOB) --> COBOL OBJECT
INCLUDE SYSLIB(MVS2CSAM) --> C OBJECT
NAME MVSC2COB(R)
//SYSUT1 DD UNIT=SYSDA,DCB=BLKSIZE=1024,
// SPACE=(1024,(200,20))


C source :

#pragma linkage (BITSCOB,COBOL)
void BITSCOB(long,long*,long*);
void main ()
{
BITSCOB(Options, &CompCode, &Reason);
}

Cobol Module (BITSCOB) :
CBL NODYNAM,LIB,OBJECT,RENT,APOST
*
IDENTIFICATION DIVISION.
*
PROGRAM-ID. BITSCOB.
*
DATA DIVISION.
LINKAGE SECTION.
01 OPTIONS PIC 9(5) COMP-5.
01 COMPCODE PIC 9(5) COMP-5.
01 REASON PIC 9(5) COMP-5.
PROCEDURE DIVISION USING OPTIONS,COMPCODE,REASON.
DISPLAY "OPTIONS : " OPTIONS.
CALL 'EXTMETHOD' USING OPTIONS,
COMPCODE,
REASON.

Am invoking cobol from C and abends in the 'CALL' statement of Cobol.

Please advise what am missing in this whole flow.
Looking forward for all your suggestions.

Thanks
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Jan 27, 2016 8:16 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Feb 01, 2016 1:26 am    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Query For IEBPTPCH 3 padmajeet.gaikwad 13444 Mon Feb 01, 2016 10:56 pm
academyindia4 View latest post
No new posts Unable to achieve below scenario using ICETOOL 27 sirianangel 33681 Mon Feb 01, 2016 10:01 pm
academyindia4 View latest post
No new posts Need to put records a Sorting order as mentioned below. 14 Yash1911 12633 Mon Jan 25, 2016 9:50 pm
academyindia4 View latest post
No new posts how to deal with the below scenario using iebgener 7 mainframes_6002 11170 Wed Dec 07, 2011 10:34 am
DikDude View latest post
No new posts Coulu someone explain the parameters in the below code? 1 lovely sweety 11352 Thu Jun 09, 2011 3:50 pm
dbzTHEdinosauer View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3424.html