View previous topic :: View next topic
|
Author |
Message |
sjiraga
New User
Joined: 20 Apr 2009 Posts: 14 Location: Bangalore
|
|
|
|
I need help who know very-well in MQ CICS coding.
I am reading messages from one queue and putting all the messages in another queue.
For this I opened the queue two time one is in input mode and other is in output mode.
Now my questions is whether I need to close the queue two times for the QUEUE or not? |
|
Back to top |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
Good day!
Your post is confusing but you need to connect to the queue before opening the queue. When you are finish using the queue you need to close the queue then do a disconnect on the queue. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
I am reading messages from one queue and putting all the messages in another queue.
For this I opened the queue two time one is in input mode and other is in output mode.
|
This is contradictory. If you're reading (getting) from one queue and putting (writing) to another queue, you have 2 queues in use. You need to MQOPEN and MQCLOSE each queue.
Also, if your application were to MQGET from a queue and then MQPUT(1) to the same queue, you'd never, ever, empty the queue. If your application is triggered or using triggering, then you're in trouble.
Garry. |
|
Back to top |
|
|
sjiraga
New User
Joined: 20 Apr 2009 Posts: 14 Location: Bangalore
|
|
|
|
Thanks for everyone sharing the knowledge.
Garry you understand my requirement. But you need to clarify one thing i.e.
Before opening the queue we are passing Queue name for example
MOVE que-name TO MQOD-objectname
COMPUTE MQM-OPTIONS = MQOO-OUTPUT
+ MQOO-FAIL-IF-QUIESCING
CALL 'MQOPEN' USING MQM-CONNECTION-HANDLE.............
Here my question is before closing the Queue I need to move Queue name to to MQOO-OBJCTNAME. Because we have opened two QUEUE and also we need close the Queue two times then each time during the Clsoe tiem shall I need to mention Queue name like in case of MQopen.
Please can you give with some example |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
Here my question is before closing the Queue I need to move Queue name to to MQOO-OBJCTNAME. |
The MQCLOSE command does not use the name of the queue to be closed. I think that your problem arises because you are using one MQOD and one handle for the queues.
I suggest that you use an MQOD and handle for each queue you are accessing, e.g.
GMQOD and GHOBJ for the queue you will MQGET from and PMQOD and PHOBJ for the queue you will MQPUT(1) messages to. Then...
Code: |
MOVE get-que-name TO GMQOD-objectname
MOVE put-que-name TO PMQOD-objectname
CALL MQOPEN (HCONN,
GMQOD,
OPTIONS,
GHOBJ,
COMPCODE,
REASON);
CALL MQOPEN (HCONN,
PMQOD,
OPTIONS,
PHOBJ,
COMPCODE,
REASON);
OPTIONS = MQCO_NONE;
CALL MQCLOSE (HCONN,
GHOBJ,
OPTIONS,
COMPCODE,
REASON);
OPTIONS = MQCO_NONE;
CALL MQCLOSE (HCONN,
PHOBJ,
OPTIONS,
COMPCODE,
REASON);
|
Garry. |
|
Back to top |
|
|
|