Author |
Message
|
elkinsc |
Posted: Tue Apr 18, 2017 4:13 am Post subject: |
|
|
![](images/avatars/gallery/Simpsons/simpsons_edna_krabappel.gif) Centurion
Joined: 29 Dec 2004 Posts: 138 Location: Indy
|
Did you look at the sample code? |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
bruce2359 |
Posted: Tue Apr 18, 2017 4:35 am Post subject: |
|
|
![](images/avatars/58715422151eef88d5f6e3.jpg) Poobah
Joined: 05 Jan 2008 Posts: 9407 Location: US: west coast, almost. Otherwise, enroute.
|
elkinsc wrote: |
Did you look at the sample code? |
And, if you looked at sample code, what is the name of the sample program? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
chandru3183 |
Posted: Tue Apr 18, 2017 6:49 pm Post subject: |
|
|
Novice
Joined: 01 Apr 2017 Posts: 11
|
I referred MQSETMP program from the below link and trying to incorporate the changes in my program.
https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.doc/fr40770_.htm
My code looks like the below. I am passing MQRFH2 header type before calling MQPUT.
Code: |
WORKING-STORAGE SECTION.
Declare the parameters as follows:
** Connection handle
01 HCONN PIC S9(9) BINARY.
** Object handle
01 HOBJ PIC S9(9) BINARY.
** Message descriptor
01 MSGDESC.
COPY CMQMDV.
** Options that control the action of MQPUT
01 PUTMSGOPTS.
COPY CMQPMOV.
** Length of the message in BUFFER
01 BUFFER-LENGTH PIC S9(9) BINARY.
** Message data
01 BUFFER PIC X(250).
** Completion code
01 COMPCODE PIC S9(9) BINARY.
** Reason code qualifying COMPCODE
01 REASON PIC S9(9) BINARY.
PROCEDURE DIVISION.
..
..
CALL 'MQPUT'USING
HCONN,
HOBJ,
MQM-MESSAGE-DESCRIPTOR
MQM-PUT-MESSAGE-OPTIONS
BUFFER-LENGTH,
BUFFER,
COMPLETION-CODE,
REASON.
|
Query1: If it is possible, Please let me know how to user defined header in MQ put itself.
Example:
Message type: Type1
Query2: If we can not include message property in MQ put, we need to have two different call statements in the same program.
i) CALL 'MQSETMP' USING HCONN, HMSG, SETMSGOPTS, NAME, PROPDESC, TYPE, ...
ii) CALL 'MQPUT'USING .... |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
mqjeff |
Posted: Wed Apr 19, 2017 4:13 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you are using message properties, you don't use an MQRFH2.
If you are using an MQRFH2, you don't use message properties. _________________ chmod -R ugo-wx / |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
elkinsc |
Posted: Wed Apr 19, 2017 4:33 am Post subject: |
|
|
![](images/avatars/gallery/Simpsons/simpsons_edna_krabappel.gif) Centurion
Joined: 29 Dec 2004 Posts: 138 Location: Indy
|
Please do yourself a favor, look at the sample program I pointed you to several posts ago. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
bruce2359 |
Posted: Wed Apr 19, 2017 6:37 am Post subject: |
|
|
![](images/avatars/58715422151eef88d5f6e3.jpg) Poobah
Joined: 05 Jan 2008 Posts: 9407 Location: US: west coast, almost. Otherwise, enroute.
|
chandru3183 wrote: |
Query1: If it is possible, Please let me know how to user defined header in MQ put itself.
Example:
Message type: Type1
Query2: If we can not include message property in MQ put, we need to have two different call statements in the same program.
i) CALL 'MQSETMP' USING HCONN, HMSG, SETMSGOPTS, NAME, PROPDESC, TYPE, ...
ii) CALL 'MQPUT'USING .... |
Query 1: MessageProperties were invented as an optional replacement for RFH headers. Following the sample, you will need to set message properties before the MQPUT. The content of the properties is whatever you want to send from the creating app to the receiving app.
Query 2: Which 2 different CALL statements? You will need to CALL whichever MQ APIs are needed, including MQCONN, MQOPEN, etc.. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
chandru3183 |
Posted: Mon Apr 24, 2017 10:04 am Post subject: |
|
|
Novice
Joined: 01 Apr 2017 Posts: 11
|
Thanks all for the response. The provided manual says CALL 'MQSETMP' statement creates new properties. We need to call MQCRTMH prior to this call. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
bruce2359 |
Posted: Tue Apr 25, 2017 4:42 am Post subject: |
|
|
![](images/avatars/58715422151eef88d5f6e3.jpg) Poobah
Joined: 05 Jan 2008 Posts: 9407 Location: US: west coast, almost. Otherwise, enroute.
|
chandru3183 wrote: |
Thanks all for the response. The provided manual says CALL 'MQSETMP' statement creates new properties. We need to call MQCRTMH prior to this call. |
... and, what does the provided manual say about after the MQSETMP call? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
chandru3183 |
Posted: Wed Apr 26, 2017 9:40 am Post subject: |
|
|
Novice
Joined: 01 Apr 2017 Posts: 11
|
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
elkinsc |
Posted: Wed Apr 26, 2017 10:06 am Post subject: |
|
|
![](images/avatars/gallery/Simpsons/simpsons_edna_krabappel.gif) Centurion
Joined: 29 Dec 2004 Posts: 138 Location: Indy
|
Perhaps this is the code snippet Bruce was referencing:
IF COMPCODE NOT = MQCC-OK THEN
MOVE 'SETMP' TO ERROR-REQUEST
MOVE REASON TO ERR-RC
GO TO SETMP-ERROR.
Are you checking that the MQ API call worked as expected? And you are correct that is not documented because that's just what a program should do after any MQ API call, check the completion code and make a decision on how to handle failures.
Of course, I may be completely off base here.
[/url] |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
chandru3183 |
Posted: Wed Apr 26, 2017 10:15 am Post subject: |
|
|
Novice
Joined: 01 Apr 2017 Posts: 11
|
elkinsc wrote: |
Perhaps this is the code snippet Bruce was referencing:
IF COMPCODE NOT = MQCC-OK THEN
MOVE 'SETMP' TO ERROR-REQUEST
MOVE REASON TO ERR-RC
GO TO SETMP-ERROR.
Are you checking that the MQ API call worked as expected? And you are correct that is not documented because that's just what a program should do after any MQ API call, check the completion code and make a decision on how to handle failures.
Of course, I may be completely off base here.
[/url] |
I am getting 2442 as a reason code. This may be the invalid property name supplied before calling MQSETMP. I am modifying the input values and trying in trial and error method.
Question: Once MQSETMP is successful, it will automatically populating new header or we need to move the property to the MQPUT statement? |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
elkinsc |
Posted: Wed Apr 26, 2017 10:29 am Post subject: |
|
|
![](images/avatars/gallery/Simpsons/simpsons_edna_krabappel.gif) Centurion
Joined: 29 Dec 2004 Posts: 138 Location: Indy
|
The documentation for the 2442 reason code provides a list of invalid property names..
The other common error is that the put message options are not correct, quite often the version number for the options structure. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
chandru3183 |
Posted: Wed Apr 26, 2017 10:42 am Post subject: |
|
|
Novice
Joined: 01 Apr 2017 Posts: 11
|
Can anyone please provide the sample COBOL statements before and after the MQSETMP call? |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
Vitor |
Posted: Wed Apr 26, 2017 10:47 am Post subject: |
|
|
![](images/avatars/905340816499abc1cdfb07.jpg) Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
chandru3183 wrote: |
Can anyone please provide the sample COBOL statements before and after the MQSETMP call? |
Aside from the samples you've already been referred to?
You'll find sample code in all the old familiar places. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
|