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

MQ CONN thru DB2 STORED PROC


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Wed Aug 13, 2008 1:27 am
Reply with quote

Hi,

I called a DB2 STORED proc in my cobol batch program.This stored proc does some data fetch and writes it to a MQ.

Stored proc does a MQCONN, MQOPEN and MQPUT

when I call it second time it returns 2002 ( MQRC_ALREADY_CONNECTED)
therefore I coded my program in such a way that it skips MQCONN if a second call is made now it returns 2018(MQRC_HCONN_ERROR) .

As my batc process is going to write a number of messages on MQ so i do not want to close and disconnect the object ubtill the las message is written.

can any one give some insight how to go about it ?

angt
Back to top
View user's profile Send private message
Ashok Mohan

New User


Joined: 09 Sep 2008
Posts: 5
Location: US

PostPosted: Wed Sep 10, 2008 9:33 am
Reply with quote

Looks like an issue with Connection handler.
Are you using an MQ online utility(or call and MQ utility) to handle MQ operations from you calling COBOL program?

Ashok Mohan.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Sep 10, 2008 3:38 pm
Reply with quote

i think u shouldn't call MQCONN again. MQCONN call is to connect to the q manager and should be done only in the beginning to get the HCONN handle.

logical sequence of the calls (for one queue) should be

MQCONN
MQOPEN
Perform MQPUT until ur conditions are reached
MQCLOSE
MQDISC
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
No new posts Stored procedure cpu utilization DB2 1
No new posts Proc print in Mainframe All Other Mainframe Topics 4
Search our Forums:

Back to Top