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

Read the queue till end of Queue


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanatl

New User


Joined: 21 Oct 2005
Posts: 22

PostPosted: Wed Jul 09, 2008 2:07 pm
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
Ashok Mohan

New User


Joined: 09 Sep 2008
Posts: 5
Location: US

PostPosted: Wed Sep 10, 2008 9:42 am
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: 210
Location: St Katherine's Dock London

PostPosted: Wed Sep 10, 2008 2:04 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts MQ response when MQGET of a stopped q... Java & MQSeries 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts IOF Output Queue & REXX(?) All Other Mainframe Topics 2
Search our Forums:

Back to Top