Author |
Message
|
vinish |
Posted: Thu Nov 15, 2012 7:56 pm Post subject: Unable to put the XML message in MQ Queue using Cobol. |
|
|
Newbie
Joined: 15 Nov 2012 Posts: 3
|
Hi,
I am using Z/OS version. My requirement is to put a XML message in the MQ queue by attaching MQMD header and RFH2 header. When i try to put the message in the queue i am getting Completion Code as 2142. Which means there is something wrong with my Header. Since i am new to coding in MQ; i am not able to figure out what is the issue. The code is as follows:-
MQMD HEADER :-
MOVE MQMD-STRUC-ID TO MQMD-STRUCID
MOVE MQMD-VERSION-1 TO MQMD-VERSION
MOVE MQMT-REQUEST TO MQMD-MSGTYPE.
MOVE MQFMT-RF-HEADER-2 TO MQMD-FORMAT.
MOVE MQPER-NOT-PERSISTENT TO MQMD-PERSISTENCE.
MOVE MQAT-DEFAULT TO MQMD-PUTAPPLTYPE.
MOVE MQRO-NONE TO MQMD-REPORT
MOVE MQFB-NONE TO MQMD-FEEDBACK
MOVE 19360 TO MQMD-EXPIRY
MOVE MQENC-NATIVE TO MQMD-ENCODING
MOVE MQCCSI-Q-MGR TO MQMD-CODEDCHARSETID
MOVE MQPRI-PRIORITY-AS-Q-DEF
TO MQMD-PRIORITY
MOVE MQMI-NONE TO MQMD-MSGID
MOVE MQCI-NONE TO MQMD-CORRELID
MOVE '0' TO MQMD-BACKOUTCOUNT
MOVE 'XX4814A ' TO MQMD-USERIDENTIFIER.
MOVE SPACES TO MQOD-OBJECTQMGRNAME
MQMD-APPLORIGINDATA
DISPLAY 'OBJECTQMGR SET TO SPACES'
MOVE 'INQUIREACCOUNT.DP.INPUT'
TO MQTM-QNAME.
MOVE 'INQUIREACCOUNT.DP.INPUT'
TO MQTM-QNAME.
DISPLAY MQTM-QNAME.
MOVE MQTM-QNAME TO MQOD-OBJECTNAME.
MOVE MQOT-Q TO MQOD-OBJECTTYPE.
MOVE 'INQUIREACCOUNT.DP.INPUT.REPLY'
TO MQMD-REPLYTOQ
DISPLAY MQMD-REPLYTOQ.
MOVE WW-MQI-QMGR TO MQMD-REPLYTOQMGR
MOVE MQACT-NONE TO MQMD-ACCOUNTINGTOKEN
MOVE MQAT-MVS TO MQMD-PUTAPPLTYPE
COMPUTE MQPMO-OPTIONS = MQPMO-FAIL-IF-QUIESCING +
MQPMO-NO-SYNCPOINT +
MQPMO-SET-IDENTITY-CONTEXT
MOVE SPACES TO WW-MQI-MSG-BUFFER
MOVE 0 TO WA-TEMP-LEN.
PERFORM VARYING WA-CTR FROM 1 BY 1
UNTIL WA-CTR > 32760
IF WW-REQUEST-MSG(WA-CTR:33) NOT =
'</InquireAccountDetailsWSRequest>'
ADD 1 TO WA-TEMP-LEN
ELSE
MOVE 32761 TO WA-CTR
ADD 33 TO WA-TEMP-LEN
END-IF
END-PERFORM.
COMPUTE WW-MQI-MSG-BUFFER-LENGTH
= 132 + WA-TEMP-LEN + 100
MOVE WW-REQUEST-MSG(1:WA-TEMP-LEN)
TO FXRFH2-MESSAGE-IO
DISPLAY 'BUFFER-LENGTH' WW-MQI-MSG-BUFFER-LENGTH
DISPLAY 'RFH2GRP-MQ-IO-AREA:' FXRFH2-GRP-MQ-IO-AREA
MOVE WW-REQUEST-MSG(1:WA-TEMP-LEN)
TO WW-MQI-MSG-BUFFER
RFH2 HEADER :-
01 FXRFH2-GRP-MQ-IO-AREA.
03 FXRFH2-HEADER.
05 FXRFH2-STRUCID PIC X(04)
VALUE 'RFH '.
05 FXRFH2-VERSION PIC S9(09) BINARY
VALUE 2.
05 FXRFH2-STRUCLENGTH PIC S9(09) BINARY
VALUE 132.
05 FXRFH2-ENCODING PIC S9(09) BINARY
VALUE 785.
05 FXRFH2-CODEDCHARSETID PIC S9(09) BINARY
VALUE 500.
05 FXRFH2-FORMAT PIC X(0
VALUE SPACES.
05 FXRFH2-FLAGS PIC S9(09) BINARY
VALUE 0.
05 FXRFH2-NMVALUECCSID PIC S9(09) BINARY
VALUE 500.
03 FXRFH2-MESSAGE-IO PIC X(32000).
MQPUT CALL :-
CALL 'MQPUT1' USING WW-MQI-HCONN
MQOD
MQMD
MQPMO
WW-MQI-MSG-BUFFER-LENGTH
WW-MQI-MSG-BUFFER
FXRFH2-GRP-MQ-IO-AREA
WW-MQI-COMP-CODE
WW-MQI-REASON
Please suggest a solution to remove the error 2142.
Thanks in advance.. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 15, 2012 9:06 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Forget using RFH2. Use message properties.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
vinish |
Posted: Thu Nov 15, 2012 9:22 pm Post subject: |
|
|
Newbie
Joined: 15 Nov 2012 Posts: 3
|
The MQ message retrieving team needs it in RFH2 format. So please suggest what is that is missing/error in the above code. |
|
Back to top |
|
 |
exerk |
Posted: Fri Nov 16, 2012 5:10 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
vinish wrote: |
The MQ message retrieving team needs it in RFH2 format... |
Really? Ask them to justify that statement. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 16, 2012 5:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
exerk wrote: |
vinish wrote: |
The MQ message retrieving team needs it in RFH2 format... |
Really? Ask them to justify that statement. |
Especially ask why, if they need an RFH2 rather than properties, they're getting you to provide it rather than the MQ admins. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 16, 2012 6:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
vinish wrote: |
The MQ message retrieving team needs it in RFH2 format. So please suggest what is that is missing/error in the above code. |
The error is you not understanding MQ.
You provide the message properties, they retrieve them as RFH. Unless the qmgr and client are still at V6 which they should not.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Mon Nov 19, 2012 2:14 am Post subject: Re: Unable to put the XML message in MQ Queue using Cobol. |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
vinish wrote: |
So please suggest what is that is missing/error in the above code. |
[code] tags, for one thing. That would make the posted code easier to read.
vinish wrote: |
Code: |
...
MOVE '0' TO MQMD-BACKOUTCOUNT
...
COMPUTE WW-MQI-MSG-BUFFER-LENGTH
= 132 + WA-TEMP-LEN + 100
...
05 FXRFH2-STRUCLENGTH PIC S9(09) BINARY
VALUE 132.
...
05 FXRFH2-NMVALUECCSID PIC S9(09) BINARY
VALUE 500.
... |
|
MQMD-BACKOUTCOUNT requires an integer value, not a character string. WW-MQI-MSG-BUFFER-LENGTH appears to be at least 100 bytes too long. FXRFH2-STRUCLENGTH is not 132 bytes long, or else there's missing NameValueLength/Data fields. FXRFH2-NMVALUECCSID can't be 500. There may be other errors.
fjb_saper wrote: |
Forget using RFH2. Use message properties. ... You provide the message properties, they retrieve them as RFH. |
Normally, yes. But it's not clear from the original post that there even are any RFH2-related message properties to provide. |
|
Back to top |
|
 |
|