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.
Here are snippets from my test program that I wrote about seven years ago.
* THE CMQIIHV COPYBOOK NEEDS TO PROCEED THE MESSAGE TEXT
* TO WORK WITH THE OTMA PROCESSOR
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.
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
* REPLYTOQ is where OTMA will send the results
* 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