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

Calling COBOL DB2 program from a COBOL DB2 Stored procedure


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
elvisyesurajah

New User


Joined: 17 Mar 2022
Posts: 1
Location: India

PostPosted: Thu Mar 17, 2022 2:23 pm
Reply with quote

Hi There!

I've been working on a project where I've to call a COBOL DB2 batch module from a COBOL DB2 Stored Procedure. I've been getting SQLCODE -927 during the runtime. I see the failure happens when the program encounters the first SQL statement in the called program.

Both the Stored Procedure and the Batch modules are bound in different schema. When I call this batch module from another batch module bound in a different schema, it works.

It would be great if the experts in this forum can provide me pointers to debug this issue further. Please let me know if you need more information.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Mar 17, 2022 11:06 pm
Reply with quote

You can’t call as they resides in two different environments. Moreover Stored Procedures are for real-time use and quick responses and calling a batch module is defeating the sole purpose of it.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Mar 29, 2022 5:11 am
Reply with quote

The SP and its subroutine need to use the same Db2 attachment facility. Speak to your DBA.
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 -> COBOL Programming

 


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