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 Questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
sjiraga

New User


Joined: 20 Apr 2009
Posts: 13
Location: Bangalore

PostPosted: Tue May 24, 2011 6:12 pm    Post subject: MQ Questions
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: 110
Location: Puerto Rico

PostPosted: Tue May 24, 2011 7:31 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue May 24, 2011 7:38 pm    Post subject:
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: 13
Location: Bangalore

PostPosted: Thu May 26, 2011 12:00 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 26, 2011 12:39 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm
No new posts Where can i find Interview questions ... Elixir Mainframe Interview Questions 4 Sat Feb 20, 2016 12:38 am


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