Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

MQ CONN thru DB2 STORED PROC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: MQ CONN thru DB2 STORED PROC
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us