Author |
Message
|
rsmile |
Posted: Wed Feb 20, 2008 10:24 pm Post subject: Modifying MQMD Headers |
|
|
Apprentice
Joined: 13 Feb 2008 Posts: 38
|
I'm trying to modify MQMD headers in the output root.
I need to modify msgType,MsgId,CorrelId,GroupId & MsgSeqNumber inside the flow.
I have a clue that I need to get this done by changing MQRFH2 header.
Could some one tell me how to get this done? |
|
Back to top |
|
 |
AJStar |
Posted: Wed Feb 20, 2008 11:02 pm Post subject: |
|
|
 Acolyte
Joined: 27 Jun 2007 Posts: 64
|
Code: |
SET OutputRoot.MQMD.<whatever you want to modify> = <value>; |
MQMD and MQRFH2 are separate entities.
Just look up the message tree structure in documentation. _________________ Regards
AJ |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 21, 2008 2:27 am Post subject: Re: Modifying MQMD Headers |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rsmile wrote: |
I have a clue that I need to get this done by changing MQRFH2 header. |
It's not a clue, it's a red herring. Or a red trout, depending on who gave it to you...  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rsmile |
Posted: Thu Feb 21, 2008 5:03 am Post subject: |
|
|
Apprentice
Joined: 13 Feb 2008 Posts: 38
|
Then how can I set the MsgId? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 21, 2008 5:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rsmile wrote: |
Then how can I set the MsgId? |
Using the code posted earlier in this thread.
I will repeat the often-repeated warning that setting either MsgId or CorrelId is a bad practice - I don't mean setting the CorrelId to an inbound MsgId for reply purposes but setting either to "ABCD1234" or similar.
Use the system facilities to generate such idents. It's much better and doesn't cause problems in the long run, as manually set ones inevitably do.
The Search Button will turn up any number of threads on the subject. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqmatt |
Posted: Thu Feb 21, 2008 5:14 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
You can also change values in the MQMD without resorting to ESQL; try the Transport Header Nodes Supportpac IA9S (http://www.ibm.com/support/docview.wss?rs=171&uid=swg24016629&loc=en_US&cs=utf-8&lang=en)
This is a relatively new supportpac; I'd be interested in your feedback. |
|
Back to top |
|
 |
rsmile |
Posted: Thu Feb 21, 2008 5:18 am Post subject: |
|
|
Apprentice
Joined: 13 Feb 2008 Posts: 38
|
I Tried to implement the code that was posted,
Quote: |
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQRFH2' NAME 'MQRFH2';
DECLARE newMsgId CHARACTER '54545464646464646464646';
SET OutputRoot.MQMD.MsgId = CAST( newMsgId AS BLOB CCSID InputRoot.Properties.CodedCharSetId);
|
I'm getting a parser exception saying that length must be correct. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 21, 2008 5:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What is the proper length for an MQMD.MsgID field?
What is the proper length for a hex character representation of a binary string of that length? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rsmile |
Posted: Thu Feb 21, 2008 5:24 am Post subject: |
|
|
Apprentice
Joined: 13 Feb 2008 Posts: 38
|
when I checked the help system, it gave the type for MsgId as MQBYTE24.
I believe the length should be 24. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 21, 2008 5:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rsmile wrote: |
I Tried to implement the code that was posted |
No you didn't. The code posted didn't mention CREATE at all.
And if the field length is 24, why have you specified the wrong length literal?
I repeat my comments about not setting the field manually. This sort of thing keeps happening. What requirement are you trying to satisfy, that calls for the id to be set? There are very, very few valid reasons for doing it (I repeat the search suggestion). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rsmile |
Posted: Thu Feb 21, 2008 5:38 am Post subject: |
|
|
Apprentice
Joined: 13 Feb 2008 Posts: 38
|
Vitor,
I understand what you are saying, this is not the preferred way of setting the message id.
I'm unaware of setting the values using system facilities.So was doing this!
This is my code now, my literal is of length 24.
Quote: |
DECLARE newMsgId CHARACTER '35343534353436343634363';
SET OutputRoot.MQMD.MsgId = CAST( newMsgId AS BLOB CCSID InputRoot.Properties.CodedCharSetId); |
|
|
Back to top |
|
 |
rsmile |
Posted: Thu Feb 21, 2008 5:39 am Post subject: |
|
|
Apprentice
Joined: 13 Feb 2008 Posts: 38
|
Could you please help me in understanding how to set the msgid using system utilities? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 21, 2008 5:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rsmile wrote: |
Could you please help me in understanding how to set the msgid using system utilities? |
It's a setting on the MQOutput node, equivalent to the put option NEW_MSG_ID. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 21, 2008 5:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rsmile wrote: |
This is my code now, my literal is of length 24.
|
Which is still too short - the MsgId is NOT a character field. Attempts to treat it as such will only accelerate your slide towards doom! _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 21, 2008 5:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What requirement are you trying to fulfill, that you're trying to set these? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|