View previous topic :: View next topic |
Author |
Message |
Koppuramesh Beginner
Joined: 31 Dec 2002 Posts: 9 Topics: 5
|
Posted: Wed Sep 24, 2003 8:59 am Post subject: MQ-GET |
|
|
Hi,
There are some records(messages) sitting in local MQ.
I need to extract those records from a "local" MQ into a copy book and execute a start to a CICS program passing data to programs.
What MQ functions i need to perform to do a GET? and What all the exceptions that i need to handle? can some one throw light on this.
Thanks. |
|
Back to top |
|
|
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Wed Sep 24, 2003 10:28 am Post subject: |
|
|
This is not a easy one to explain, but there are excellent reference manuals on the reference page.
Code: |
1. Connect to the Q
CALL 'MQCONN' USING WS-QMGR-NAME
WS-QHCONN
WS-QCOMPCODE
WS-QREASON
2. Open the Q
CALL 'MQOPEN' USING WS-QHCONN
MQOD
WS-Q-OPT
WS-QHOBJ
WS-QCOMPCODE
WS-QREASON
3. Get from the Q (this is where we loop to get all the messages)
CALL 'MQGET' USING WS-QHCONN
WS-QHOBJ
MQMD
MQGMO
WS-QUEUE-DATA-LENGTH
WS-QUEUE-DATA-AREA
4. Close the Q
CALL 'MQCLOSE' USING WS-QHCONN
WS-QHOBJ
WS-Q-OPT
WS-QCOMPCODE
WS-QREASON
5. Disconnect from the Q
CALL 'MQDISC' USING WS-QHCONN
WS-QCOMPCODE
WS-QREASON
|
IBM has provided good 'Stub' programs in the SAMPLIB, even their manuals have sample code (Cobol) how to perform different tasks. Hope it helps |
|
Back to top |
|
|
Koppuramesh Beginner
Joined: 31 Dec 2002 Posts: 9 Topics: 5
|
Posted: Thu Sep 25, 2003 5:41 pm Post subject: |
|
|
Thank you Suresh. |
|
Back to top |
|
|
|
|