CALL 'MQOPEN' USING WS-MQI-CONNECTION-HANDLE
WS-MQI-OBJECT-DESCRIPTOR
WS-MQI-OBJECT-OPTIONS
WS-MQI-GETOBJ-HANDLE
WS-MQI-COMPLETION-CODE
WS-MQI-REASON-CODE
IF WS-MQI-COMPLETION-CODE = MQCC-FAILED
* BUILT THE ERROR RECORD
PERFORM 2300-SEND-ERROR-MESSAGE
END-IF
*********************
* OPEN OUTPUT QUEUE
*********************
MOVE MQOT-Q TO MQOD-OBJECTTYPE
MOVE WS-MQI-REP-QUEUE TO MQOD-OBJECTNAME
COMPUTE WS-MQI-OBJECT-OPTIONS = MQOO-OUTPUT +
MQOO-FAIL-IF-QUIESCING
CALL 'MQOPEN' USING WS-MQI-CONNECTION-HANDLE
WS-MQI-OBJECT-DESCRIPTOR
WS-MQI-OBJECT-OPTIONS
WS-MQI-PUTOBJ-HANDLE
WS-MQI-COMPLETION-CODE
WS-MQI-REASON-CODE
************************************************
here can I use same variable to have connection handle. if yes then how MQ going to decide who's who?
If not; then I guess I have to use different variables .... right? _________________ Sanjoo
One connection handle = one connection to a given queue manager
You should review whether you really need to connect to two queue managers. Generally you should connect to one and route messages to/from other queue managers using remote queues and channels.
If you are on a mainframe, then you cannot connect as a client and therefore the question does not usually arise. If your mainframe has more than one queue manager - I would ask why?
MQ application programs should be as decoupled as possible from the topology of the infrastructure.
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
You are typing "connection handle", but I suspect you mean "object handle". If you open two queues, and you want to reference them both, you need two variables to hold the handles. _________________ -wayne
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum