View previous topic :: View next topic
|
Author |
Message |
manojsharma1122
New User
Joined: 24 Jul 2007 Posts: 12 Location: india
|
|
|
|
Hi,
I am trying to implement an MQ-IMS functionality in one of my cobol code. I have to pass data through MQ to a particular IMS region where my IMS transaction should get triggered. For this I have got an MQ defined as an OTMA and is mapped to the required IMS region.
Can anyone please help me about the format of the data to be put into the MQ. I know I have to use the MQIIH header format but not sure how it should be used while making MQ calls. Also there is concept of LL & ZZ fields where LL should be the total length including LLZZ. How to calculate this LL field.
Thanks for any help you provide me on this.
Manoj |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Here are snippets from my test program that I wrote about seven years ago.
Code: |
* THE CMQIIHV COPYBOOK NEEDS TO PROCEED THE MESSAGE TEXT
* TO WORK WITH THE OTMA PROCESSOR
01 W00-MSGBUFFER.
05 MQM-IIH-HEADER.
COPY CMQIIHV.
05 W00-MSGBUFFER-LENGTH-LLZZ.
10 W00-MSGBUFFER-LENGTH-LL PIC 9(04) COMP.
10 W00-MSGBUFFER-LENGTH-ZZ PIC 9(04) COMP.
05 W00-MSGBUFFER-ARRAY PIC X(1) OCCURS 65535 TIMES. |
Code: |
MOVE MQICM-SEND-THEN-COMMIT TO MQIIH-COMMITMODE
MOVE MQMT-REQUEST TO MQMD-MSGTYPE
* MQFMT-IMS tells OTMA that there is an IIH header
MOVE MQFMT-IMS TO MQMD-FORMAT
* MQFMT-IMS-VAR-STRING is the llzz protocol, so the
* first 4 bytes show the length of the segment in the
* request data. The REPLYTOFORMAT tells MQ to send the
* reply using the same protocol.
MOVE MQFMT-IMS-VAR-STRING TO MQIIH-FORMAT
MQIIH-REPLYTOFORMAT |
Code: |
* REPLYTOQ is where OTMA will send the results
MOVE 'xxxxxxx.IMSBRIDGE.REPLY.QUEUE'
TO MQMD-REPLYTOQ
* The TOTAL MQ message length is the IIH header (84 bytes),
* plus the LLZZ (4 bytes), plus the actual message (varies).
* The length for LL is ONLY the length of the IMS message.
MOVE 0 TO W00-MSGBUFFER-LENGTH-ZZ
ADD +4 TO W00-MSGLENGTH
MOVE W00-MSGLENGTH TO W00-MSGBUFFER-LENGTH-LL
ADD LENGTH OF MQM-IIH-HEADER TO W00-MSGLENGTH |
Code: |
CALL 'MQPUT' USING W03-HCONN
W03-HOBJ
MQMD
MQPMO
W00-MSGLENGTH
W00-MSGBUFFER
W03-COMPCODE
W03-REASON
|
|
|
Back to top |
|
|
arindam111
New User
Joined: 29 Nov 2006 Posts: 27 Location: India
|
|
|
|
Also, make sure you use correlation id of PUT call to the message ID of the RECEIVE call in case you are receiving from MQ. |
|
Back to top |
|
|
|