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: 2945
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: 741
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 Cobol prog to put an indicator on the... JCL & VSAM 1
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts COBOL program logic for comparisipn o... COBOL Programming 2
No new posts Calling IEHPROGM from REXX CLIST & REXX 7
Search our Forums:

Back to Top