IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

MQ Questions


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sjiraga

New User


Joined: 20 Apr 2009
Posts: 14
Location: Bangalore

PostPosted: Tue May 24, 2011 6:12 pm
Reply with quote

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
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Tue May 24, 2011 7:31 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue May 24, 2011 7:38 pm
Reply with quote

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
View user's profile Send private message
sjiraga

New User


Joined: 20 Apr 2009
Posts: 14
Location: Bangalore

PostPosted: Thu May 26, 2011 12:00 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu May 26, 2011 12:39 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
No new posts Mainframe Interview Questions CICS,CO... Mainframe Interview Questions 6
No new posts Viewing executing process in NDM .. q... IBM Tools 0
No new posts INCLUDE condition questions DFSORT/ICETOOL 1
Search our Forums:

Back to Top