View previous topic :: View next topic
|
Author |
Message |
angt
New User
Joined: 01 Jun 2005 Posts: 17 Location: USA
|
|
|
|
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 |
|
|
Ashok Mohan
New User
Joined: 09 Sep 2008 Posts: 5 Location: US
|
|
|
|
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 |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
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 |
|
|
|