Posted: Wed Sep 10, 2014 6:53 pm Post subject: How to set MQRFH2 header in MQ using COBOL
Newbie
Joined: 10 Sep 2014 Posts: 7
I have requirement to add user header in MQ message to include some user defined properties (meta data) for receiving application to know which message it is. For that i found that need to set MQRFH2 header to achieve this. Can any one please let me know how to set MQRFH2 header.
I have found MQRFH2 copybook layout.
Code:
** MQRFH2 structure
10 MQRFH.
** Structure identifier
15 MQRFH-STRUCID PIC X(4) VALUE 'RFH '.
** Structure version number
15 MQRFH-VERSION PIC S9(9) BINARY VALUE 2.
** Total length of MQRFH2 including all NameValueLength and
** NameValueData fields
15 MQRFH-STRUCLENGTH PIC S9(9) BINARY VALUE 36.
** Numeric encoding of data that follows last NameValueData field
15 MQRFH-ENCODING PIC S9(9) BINARY VALUE 785.
** Character set identifier of data that follows last
** NameValueData field
15 MQRFH-CODEDCHARSETID PIC S9(9) BINARY VALUE -2.
** Format name of data that follows last NameValueData field
15 MQRFH-FORMAT PIC X(8) VALUE SPACES.
** Flags
15 MQRFH-FLAGS PIC S9(9) BINARY VALUE 0.
** Character set identifier of NameValueData
15 MQRFH-NAMEVALUECCSID PIC S9(9) BINARY VALUE 1208.
It would be greatful if you provide sample COBOL code...Thanks
Well you are running into some challenges here.
It does not look that the structure includes the name/value content,
the length of the structure is byte aligned on 4 bytes...
I would encourage you to look up the COBOL manual and try and use properties in handle...
Posted: Thu Sep 11, 2014 4:57 am Post subject: Re: How to set MQRFH2 header in MQ using COBOL
Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
speeleti_MF wrote:
I have requirement to add user header in MQ message to include some user defined properties (meta data) for receiving application to know which message it is. For that i found that need to set MQRFH2 header to achieve this.
Only if you're using an out of support version of WMQ, in which case you're in a Hell of your own making.
Set the properties directly. If (by some chance) the receiving program physically requires an RFH2 header because it's old, get the queue manager to sort it out for you. _________________ Honesty is the best policy.
Insanity is the best defence.
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