Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Read the queue till end of Queue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES
Author Message
rohanatl

New User


Joined: 21 Oct 2005
Posts: 20

PostPosted: Wed Jul 09, 2008 2:07 pm    Post subject: Read the queue till end of Queue
Reply with quote

HI I am new to Mq Series.
Right now I have a requirement in which i need to read the message from the MQ and need to write to a File.
My questioin is Is how to read the queue until end of Queue.
DO i need to give the Call to get the msg in a til end of queue
and to check the end of queue

Thanks
Rohan
Back to top
View user's profile Send private message
References
PostPosted: Wed Jul 09, 2008 2:07 pm    Post subject: Re: Read the queue till end of Queue Reply with quote

Ashok Mohan

New User


Joined: 09 Sep 2008
Posts: 5
Location: US

PostPosted: Wed Sep 10, 2008 9:42 am    Post subject:
Reply with quote

In the MF system that I am currently we use a MQ tool (Q to file) which drains all msg's and writes it to a file.

MQS2FILE - is the common program that is provided by MQ team to drain msg's and put msg's.

Ashok Mohan.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 86
Location: London

PostPosted: Wed Sep 10, 2008 2:04 pm    Post subject:
Reply with quote

You can try this.
Perform MQGET until MQRC-NO-MSG-AVAILABLE is returned.

Code:

  CALL 'MQGET' USING W03-HCONN,                   
                     W03-HOBJ-INPUT-INIT,         
                     MQM-MESSAGE-DESCRIPTOR,       
                     MQM-GET-MESSAGE-OPTIONS,     
                     BUFFER-LENGTH,               
                     TEMP-INIT-MSG,               
                     W03-DATA-LENGTH,             
                     W03-COMPCODE,                 
                     W03-REASON.                   
                                                   
  MOVE W03-REASON TO WW-MQ-REASON                 
                                                   
  IF W03-REASON IS EQUAL TO MQRC-NO-MSG-AVAILABLE 
     MOVE 'Y'  TO  EOQ-REACHED
     GO TO F02-EXIT                               
  END-IF.         

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES All times are GMT + 6 Hours
Page 1 of 1