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 ?
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?