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 Index » Mainframe, CICS, TXSeries » Message = MQMD + MQRFH2 + DATA in MQ.

Post new topic  Reply to topic Goto page 1, 2  Next
 Message = MQMD + MQRFH2 + DATA in MQ. « View previous topic :: View next topic » 
Author Message
chandu85
PostPosted: Mon Dec 05, 2011 8:04 am    Post subject: Message = MQMD + MQRFH2 + DATA in MQ. Reply with quote

Newbie

Joined: 28 Nov 2011
Posts: 7

Hi All,

I am looking for sample cobol-cics code to put a message on queue using the format - MQMD + MQRFH2 + DATA .

I have gone through the forum and found the below url

http://www.mqseries.net/phpBB2/viewtopic.php?t=24875&sid=2d1a5d6a89a687d7dadd8cfb8e2f05d1


But I felt it was not described fully, Could someone please provide any URL
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 05, 2011 8:31 am    Post subject: Re: Message = MQMD + MQRFH2 + DATA in MQ. Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

chandu85 wrote:
But I felt it was not described fully


No, because it's talking about a different issue.

chandu85 wrote:
Could someone please provide any URL


Well the answers you got on your near-identical post here should provide some insight. Including the very valid of point not using an RFH2 at all if you're on WMQv7.

Also the product InfoCenter (link at the top of this page) describes all the headers.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
chandu85
PostPosted: Mon Dec 12, 2011 4:21 am    Post subject: Reply with quote

Newbie

Joined: 28 Nov 2011
Posts: 7

Hi Vitor,

We are connecting SystemA ( Mainframe ) and SystemB ( Small system , not Mainframe ). SysteB is developed in such way that whatever the data coming inside from SystemA using MQ should use MQRFH2 format ( Ofcourse, it is sucessful system definately they are using later MQV7 ).

I am Mainframe developer and new to MQ and XML, I read the Application Programming Reference document and still reading the document and some questions on how writte COBOL + CICS + MQ code that in such way that to PUT a data in MQ1 of SystemB and GET data from MQ2 of SysteB, Where MQ1 will accept data if the data in MQMD + MQRFH2 + DATA and same way GET MQ2 will have data in MQRFH2 format.

Example :

I would like to transfer data ( ABCDEFGHIJKLMN ) from SYSTEMA to SYSTEMB using MQs.

SYSTEMB says, data will be accepted through MQ. AND MQ should have MQMD and MQRFH2.

From MQ manuals I understood that data should be kept in a MQ's specified format then only data can be sent/receive from MQ's. The format is MQ DATA = HEADER + DATA
where HEADER = MQMD + MQRFH2
DATA = ABCDEFGHIJKLMN.( Correct me If I am wrong ).

Before calling MQPUT or MQGET, header fileds of MQMD and MQRFH2 fields should be papulated by the ( COBOL code ) program. ( Correct me if my wrong ).

Questions :

1. While I am reading the MQRFH2 header descriptions found a filed calld NameValueData , I do not understand what data should be kept in this filed.

2. Is 'NameValueData' field filled by program ( COBOL code ) before MQGET OR MQPUT.

3. Is XML code papulated using program ( using COBOL STRING,UNSTRING verbs etc ) and finally move to 'NameValueData' field of MQRFH2 header.

3. Is any relation between 'NameValueData' field and DATA = ABCDEFGHIJKLMN for this example.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 12, 2011 5:56 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

chandu85 wrote:
We are connecting SystemA ( Mainframe ) and SystemB ( Small system , not Mainframe ). SysteB is developed in such way that whatever the data coming inside from SystemA using MQ should use MQRFH2 format ( Ofcourse, it is sucessful system definately they are using later MQV7 ).


If they're using v7 you shouldn't be using an MQRFH2 but message properties. Unless your mainframe is still at v6. Which it shouldn't be.

chandu85 wrote:
From MQ manuals I understood that data should be kept in a MQ's specified format then only data can be sent/receive from MQ's. The format is MQ DATA = HEADER + DATA
where HEADER = MQMD + MQRFH2
DATA = ABCDEFGHIJKLMN.( Correct me If I am wrong ).


You're wrong. Data in the sense you describe is payload which WMQ has no prefredined format for. Try the manuals again.

chandu85 wrote:
Before calling MQPUT or MQGET, header fileds of MQMD and MQRFH2 fields should be papulated by the ( COBOL code ) program. ( Correct me if my wrong ).


Subject to the above comments about an RFH2 in v7, the RFH2 should be set up, the MQMD catered for. The queue manager will populate it for you but if you're using an RFH2 and/or a CICS header you have to handle that in the MQMD yourself.

chandu85 wrote:
1. While I am reading the MQRFH2 header descriptions found a filed calld NameValueData , I do not understand what data should be kept in this filed.


The data you wish/need to place in the RFH2.

chandu85 wrote:
2. Is 'NameValueData' field filled by program ( COBOL code ) before MQGET OR MQPUT.
.

It's filled before a put and populated by the get.

chandu85 wrote:
3. Is XML code papulated using program ( using COBOL STRING,UNSTRING verbs etc ) and finally move to 'NameValueData' field of MQRFH2 header.


I doubt it. It's XML like but not a document, and your payload doesn't sound much like XML either.

chandu85 wrote:
3. Is any relation between 'NameValueData' field and DATA = ABCDEFGHIJKLMN for this example.


I don't see one.

If SystemB is mandating the use of an RFH2, why not ask them what they expect in it?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
chandu85
PostPosted: Mon Dec 12, 2011 6:55 am    Post subject: Reply with quote

Newbie

Joined: 28 Nov 2011
Posts: 7

Hi Vitor,

Quote:
chandu85 wrote:
From MQ manuals I understood that data should be kept in a MQ's specified format then only data can be sent/receive from MQ's. The format is MQ DATA = HEADER + DATA
where HEADER = MQMD + MQRFH2
DATA = ABCDEFGHIJKLMN.( Correct me If I am wrong ).

Vitor Wrote

You're wrong. Data in the sense you describe is payload which WMQ has no prefredined format for. Try the manuals again.


I am searching for the meanig of PAYLOAD in Application Programming Reference document, but I am not. can you tell me the meaning of it ( I am learning the basics ).

may be I am missing something here,so written question in detail.

MQ MESSAGE = HEADER + DATA
where HEADER = MANDATATORY HEADER + OPTIONAL HEADERS , DATA = ABCDEFGHIJKLMN .
MANDATATORY HEADER = MQMD,OPTIONAL HEADER = MQRFH2 ( for my case ).

I will comeup with remaining points whichyou commented in the post.

Thanks for understanding Vitor.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 12, 2011 7:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

chandu85 wrote:
From MQ manuals I understood that data should be kept in a MQ's specified format then only data can be sent/receive from MQ's. The format is MQ DATA = HEADER + DATA
where HEADER = MQMD + MQRFH2
DATA = ABCDEFGHIJKLMN.( Correct me If I am wrong ).


Ok, in that sense I conceed it's a specified format in that it must be preceeded by at least the MQMD.

chandu85 wrote:
I am searching for the meanig of PAYLOAD in Application Programming Reference document, but I am not. can you tell me the meaning of it ( I am learning the basics ).


The payload of a WMQ message is what you're describing as data. There is a large amount of "data" in a WMQ message, especially with multiple headers in use and much of it does have specific formats (especially the RFH2!) and "payload" is a better term to describe the non-WMQ mandated part of the message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
chandu85
PostPosted: Mon Dec 12, 2011 7:57 am    Post subject: Reply with quote

Newbie

Joined: 28 Nov 2011
Posts: 7

Hi Vitor,

I have understood the meaning of Payload now.

for the remaining points,

Quote:
chandu85 wrote:
1. While I am reading the MQRFH2 header descriptions found a filed calld NameValueData , I do not understand what data should be kept in this filed.

Vitor wrote:

The data you wish/need to place in the RFH2.


I will describe my question with an example in more detail.

I have data NAME BRITHDATE TELEPHONENUMBER PHONE ADDRESS to be transmitted. for this what data i need to placed in 'NameValueData' field of MQRFH2 header.


Quote:
chandu85 wrote:
3. Is XML code papulated using program ( using COBOL STRING,UNSTRING verbs etc ) and finally move to 'NameValueData' field of MQRFH2 header.


Vitor wrote:
I doubt it. It's XML like but not a document, and your payload doesn't sound much like XML either.



If my data is like

NAME BRITHDATE TELEPHONENUMBER PHONE ADDRESS

then I should form the xml code in COBOL using UNSTRING,STRING and INSPECT then final format string should be moved to a final variable of MQRFH2

could you please refer the below link http://www.mqseries.net/phpBB2/viewtopic.php?t=42672.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Dec 12, 2011 8:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

We have no idea what pieces of information you need to actually put into the RFH2.

The process that is going to be reading the RFH2 will know what information it is looking for.

You should not be using an RFH2 for anything with MQ v7 and later. You should use message properties, which you can access from COBOL using MQSETMP - http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/fg20710_.htm
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 12, 2011 8:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

chandu85 wrote:
I have data NAME BRITHDATE TELEPHONENUMBER PHONE ADDRESS to be transmitted. for this what data i need to placed in 'NameValueData' field of MQRFH2 header.


None. You don't need an RFH2 header at all, it's optional. It seems to be this SystemB that's consuming the message that wants it so it's up to them what they want in it.

chandu85 wrote:
then I should form the xml code in COBOL using UNSTRING,STRING and INSPECT then final format string should be moved to a final variable of MQRFH2

could you please refer the below link http://www.mqseries.net/phpBB2/viewtopic.php?t=42672.


I would be fairly suprised if that's what your consumers are expecting. That 3 year old thread you referenced is talking about setting JMS properties. I would expect that your message is expected to have an RFH2 with properties set (if it's a JMS application the JMS specific properties are carried in part in the RFH2) with your payload (NAME and so forth) following that in an XML format.

So the question remains. Why does SystemB expect an RFH2 header and what do they want in it?

I mean, if you use the coding in that thread to pass the details as properties and they're expecting to be parsing the payload for them, it's not going to end that well is it? Likewise if you put the details in the RFH2 and/or the payload but don't set the other RFH2 properties they expect it's going to fail.

Obtain the requirements. Then design your code.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 12, 2011 8:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

It's also worth underlining that that 3 year old thread was started because the code posted failed to correctly create an RFH2. So if you use that to build an RFH2 you're going to be out of luck.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Dec 12, 2011 11:16 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Take a look at this URL. It describes the RFH2 header, and its intended use:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Faq06930_.htm

Is this really a requirement?
_________________
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
View user's profile Send private message
Vitor
PostPosted: Mon Dec 12, 2011 11:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bruce2359 wrote:
Take a look at this URL. It describes the RFH2 header, and its intended use:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Faq06930_.htm


Where did WMB pop up from? I thought this was just z/OS CICS COBOL -> distributed JMS
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Dec 12, 2011 11:22 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Lack of OP clarity. JMS? MB? Message properties? Not sure exactly what the OP wants or needs.

COBOL and CICS seem like red-herrings in this discussion.
_________________
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
View user's profile Send private message
gbaddeley
PostPosted: Mon Dec 12, 2011 2:52 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Vitor wrote:
chandu85 wrote:
From MQ manuals I understood that data should be kept in a MQ's specified format then only data can be sent/receive from MQ's. The format is MQ DATA = HEADER + DATA
where HEADER = MQMD + MQRFH2
DATA = ABCDEFGHIJKLMN.( Correct me If I am wrong ).


Ok, in that sense I conceed it's a specified format in that it must be preceeded by at least the MQMD.


An MQ message consists of two parts.

1) The Message Descriptor structure (aka MQMD, version 1 or 2)
This consists of a well defined set of field values. They are documented in the WMQ App Programming Reference.

2) The Message Data (aka payload)
This can contain any format of data (eg. text, images, pdf, encrypted, there are no limitations). There are some formats which MQ is aware of and can take action on them, such including an RFH header, which is usually followed by application data. The RFH header can contain Message Properties. MQI function calls were added to MQ v7.0 to allow standard manipulation of these properties by apps, without them needing to build and manage the RFH headers themselves. Some app environments were aware of RFH and message properties prior to v7.0, such as JMS.

The MQMD fields are also considered to be Message Properties.
_________________
Glenn
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Dec 12, 2011 8:30 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

OK, I'm surprised that nobody mentioned this to you before. But if working with V7 you can set the message properties and have the system transform them into an RFH2. See the property control parameter on the queue / channel.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » Message = MQMD + MQRFH2 + DATA in MQ.
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.