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

Calling a DB2 program from a Pure Cobol Program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
surya71

New User


Joined: 08 Dec 2006
Posts: 2
Location: Los Angeles

PostPosted: Mon Mar 12, 2007 10:27 am
Reply with quote

i have a pure cobol program which has a static call to a cobol-Db2 program.I am not able to run the cobol program with IKJEFT01 as it is giving me a S0c6 abend. when it encounters the first SQL.Please help me how to run these program
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Mon Mar 12, 2007 12:02 pm
Reply with quote

What is the SQL code ..?
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: Mon Mar 12, 2007 7:11 pm
Reply with quote

Hello,

Please post the abend information.

Might the abend be 806?
Back to top
View user's profile Send private message
surya71

New User


Joined: 08 Dec 2006
Posts: 2
Location: Los Angeles

PostPosted: Mon Mar 12, 2007 8:25 pm
Reply with quote

There is no SQL code coming.When it encounters the first SQL Statement ie, in this case an open cursor statement before it comes out of the SQL itself it gives a S0c6.Is there any jcl changes to be made? The Calling Program is a Cobol only program and the sub program is a cobol-DB2 program.How will i compile the main program when the call is static or dynamic.When will i use the IKJEFT01

Thanks
Surya
Back to top
View user's profile Send private message
anjankumar_r

New User


Joined: 22 May 2008
Posts: 7
Location: India

PostPosted: Thu May 22, 2008 9:12 pm
Reply with quote

Hello,

I'm also encountering exactly the same problem now. When i tried searching for the solution, i found this forum. But i couldn't see any solution posted for this. :roll:

Do anyone have a solution to this?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 22, 2008 9:32 pm
Reply with quote

we have two people that have an identical problem. isn't it odd, that neither of them provided anything else except the usual 'Oh help me!. I have a problem.'.

Unless you perform your own db2 connect, you will have to invoke your run unit via IKJEFtnn.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri May 23, 2008 12:49 pm
Reply with quote

Can u post the Bind and Run Jcl pls
Back to top
View user's profile Send private message
anjankumar_r

New User


Joined: 22 May 2008
Posts: 7
Location: India

PostPosted: Fri May 23, 2008 1:11 pm
Reply with quote

Here is the abend information..
the program PG0G254A is the calling cobol program and the pgm PG0RZ480 is the I/O module. Pls let me know if you need any more information.


READY
DSN SYSTEM (GT2T)
DSN
RUN PROG (PG0G254A) PLAN (PL0G254A)
DSN ENDED DUE TO ERROR+
SYSTEM ABEND CODE 0C6 REASON CODE 00000006

CEE3206S THE SYSTEM DETECTED A SPECIFICATION EXCEPTION (SYSTEM COMPLETION CODE=0C6).
FROM COMPILE UNIT PG0RZ480 AT ENTRY POINT PG0RZ480 AT COMPILE UNIT OFFSET +00012560 AT ENTRY OFFSET +00012560 AT ADDRESS 1809D9C8.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Fri May 23, 2008 1:19 pm
Reply with quote

I suppose this should be a problem with link-edit. Proper DSNHLI interface module hasn't been included while link-editing your program.

Any suggestions are welcome.
Back to top
View user's profile Send private message
anjankumar_r

New User


Joined: 22 May 2008
Posts: 7
Location: India

PostPosted: Fri May 23, 2008 2:07 pm
Reply with quote

Hi

I use mainframe express to compile the cobol-db2 code in the mainframe. we dont specify anything during the link-edit.


Thanks
Anjan
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: Fri May 23, 2008 11:04 pm
Reply with quote

Hello,

Are there other programs being successfully compiled/run via mainframe express or is this the first attempt?

If others work, compare what is different now.

If this is the first attempt, you should work with your db2 & compiler support people to resolve.
Back to top
View user's profile Send private message
anjankumar_r

New User


Joined: 22 May 2008
Posts: 7
Location: India

PostPosted: Mon May 26, 2008 1:15 pm
Reply with quote

Hi,

I'm using it for quite a long time. But, the problem is, I'm using the utility IKJEFT01 utility for running the cobol-db2 program for the first time.
Earlier I used to use some other PROC to run the program and it works still fine using that PROC jcl. But the problem occurs when i try to run using the IKJEFT01 utility.

Thanks
Anjan
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: Mon May 26, 2008 6:57 pm
Reply with quote

Hello,

I believe you need to talk with your db2 or system support people to make sure that all of the system datasets used are the correct ones.

Is there any IKJEFT01/db2 code that is working when prepared outside of Mainframe Express?

Are any warnings generated by the compile/link or the actual run prior to the abend?
Back to top
View user's profile Send private message
ggogate

New User


Joined: 21 Jan 2009
Posts: 1
Location: Mumbai

PostPosted: Wed Jan 21, 2009 5:18 pm
Reply with quote

I had the same problem. I removed DB2-IMS attach and changed the route card from

/*ROUTE XEQ DB2XSHR to
/*ROUTE XEQ DB2X

(where DB2X is the DB2 Region in which I want to run my program)

It worked.
Back to top
View user's profile Send private message
denisvenis
Currently Banned

New User


Joined: 11 Jan 2009
Posts: 1
Location: London

PostPosted: Sat Jan 24, 2009 12:30 pm
Reply with quote

i think you not provioded the libraary from from where load module will get picked up

MEntion like below

LIB('YOUR-LIBRARY-NAME')
Back to top
View user's profile Send private message
shan007

New User


Joined: 28 Jun 2009
Posts: 3
Location: bangalore

PostPosted: Thu Mar 18, 2010 1:38 am
Reply with quote

hi,

U need to have a DSNPRAMS in the run jcl of the pure cobol program. It will take care of the COBOL-DB2 program you are calling. DSNPRAM actually substitued by IKJEFT01

e.g
//Job card
//step1 EXEC PGM= pure cobol prog
//steplib .....
//sysout dd *
//dsnparms dd dsn= PDS(member)

in the PDS member u need to specify the below

open fetch close DSNsync(cobol-db2 prog name)

Correct me if I am wrong.
thanks,
shan007
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: Thu Mar 18, 2010 2:15 am
Reply with quote

Hello and welcome to the forum,

I suspect more is needed to connect to the db2 subsystem. . .
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top