ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexMainframe, CICS, TXSeriesQuestion on MQHRF2 data format

Post new topicReply to topic Goto page Previous  1, 2
Question on MQHRF2 data format View previous topic :: View next topic
Author Message
elkinsc
PostPosted: Tue Apr 18, 2017 4:13 am Post subject: Reply with quote

Centurion

Joined: 29 Dec 2004
Posts: 114
Location: Atlanta

Did you look at the sample code?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 18, 2017 4:35 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 7801
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 didn't know that Schrdinger had a cat.
Back to top
View user's profile Send private message
chandru3183
PostPosted: Tue Apr 18, 2017 6:49 pm Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Apr 19, 2017 4:13 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17314

If you are using message properties, you don't use an MQRFH2.

If you are using an MQRFH2, you don't use message properties.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
elkinsc
PostPosted: Wed Apr 19, 2017 4:33 am Post subject: Reply with quote

Centurion

Joined: 29 Dec 2004
Posts: 114
Location: Atlanta

Please do yourself a favor, look at the sample program I pointed you to several posts ago.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Apr 19, 2017 6:37 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 7801
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 didn't know that Schrdinger had a cat.
Back to top
View user's profile Send private message
chandru3183
PostPosted: Mon Apr 24, 2017 10:04 am Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 25, 2017 4:42 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 7801
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 didn't know that Schrdinger had a cat.
Back to top
View user's profile Send private message
chandru3183
PostPosted: Wed Apr 26, 2017 9:40 am Post subject: Reply with quote

Novice

Joined: 01 Apr 2017
Posts: 11

I hope we need to call MQPUT.
I referred the below links but they did not talk about what needs to be performed after the MQSETMP call.
https://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/PRS5189
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.ref.dev.doc/q101910_.htm
Back to top
View user's profile Send private message
elkinsc
PostPosted: Wed Apr 26, 2017 10:06 am Post subject: Reply with quote

Centurion

Joined: 29 Dec 2004
Posts: 114
Location: Atlanta

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
View user's profile Send private message
chandru3183
PostPosted: Wed Apr 26, 2017 10:15 am Post subject: Reply with quote

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
View user's profile Send private message
elkinsc
PostPosted: Wed Apr 26, 2017 10:29 am Post subject: Reply with quote

Centurion

Joined: 29 Dec 2004
Posts: 114
Location: Atlanta

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
View user's profile Send private message
chandru3183
PostPosted: Wed Apr 26, 2017 10:42 am Post subject: Reply with quote

Novice

Joined: 01 Apr 2017
Posts: 11

Can anyone please provide the sample COBOL statements before and after the MQSETMP call?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 26, 2017 10:47 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24410
Location: Ohio, 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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum IndexMainframe, CICS, TXSeriesQuestion on MQHRF2 data format
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.