Author |
Message
|
Peter |
Posted: Fri Aug 08, 2003 12:24 am Post subject: Variable length Blob to Mrm? |
|
|
Newbie
Joined: 08 Aug 2003 Posts: 1
|
Hi,
I'm trying to take variable length input messages of structure:
Id (4 bytes)
Type (16 bytes)
Text (0-4096bytes)
And split them into two messages - one containing the Id and Type (aswell as some static data) and one containing the variable length text field.
I am trying to use a null terminated mrm message type to deal with the variable length but am not being allowed to check this in (mqsi v2.0.2) with reason being: invalid padding character. Is this a bug with the control centre?
As an alternative method I have tried taking the message as a blob (Input node domain) and doing substring operations on the message to extract the id, type and text. Then passing through a ResetContentDescriptor to map to a fixed length mrm. However I am getting hex strings in my output message despite casting the results to Char.
Am I on the right track with this? any help much appreciated.
Pete |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 08, 2003 5:28 am Post subject: Re: Variable length Blob to Mrm? |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Peter wrote: |
I am getting hex strings in my output message despite casting the results to Char.
|
I don't know if this works on 2.02, but in 2.1 the solution for this problem is to include a CCSID specification to the cast function.
Code: |
cast(InputRoot.BLOB.BLOB as character CCSID InputRoot.Properties.CodedCharSetId) |
|
|
Back to top |
|
 |
jfluitsm |
Posted: Sun Aug 10, 2003 7:22 am Post subject: |
|
|
Disciple
Joined: 24 Feb 2002 Posts: 160 Location: The Netherlands
|
You can define your message as a fixed message instead of using null-terminated. As the text field is the last field in your message you can define it's lenght as end-of-message _________________ Jan Fluitsma
IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6 |
|
Back to top |
|
 |
mqhelp |
Posted: Mon Aug 11, 2003 7:11 am Post subject: |
|
|
Newbie
Joined: 20 Jun 2003 Posts: 6
|
Hi,
It did well for me on ver2.1 using null terminated String for variable length record and reparsing using ResetContentDescriptor. Please make sure you have checked out Reset Message Domain, Reset Message Set, Reset Message Set and Reset Message Format properties for ResetContentDescriptor node to have automatically the domain set to MRM and avoid hex values as in BLOB domain.
Regards,
Srini |
|
Back to top |
|
 |
Craig B |
Posted: Wed Aug 13, 2003 7:31 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
If you are using MQSI V2.02, then you will not be able to use the CAST with CCSID parameter to convert your BLOB into its true character form. This functionality was only introduced into V2.1.
In V2.02 you said that the Control Centre reported an Invalid Padding character when you attempted to use a NULL terminated String. What was the padding character set to? If the Padding character was NUL and you selected a NULL terminated string then this would be a conflict since the addition of padding characters would null terminate the string in the wrong place.
If you are using V2.1 then the best way to handle this would be to set the Last Variable length element to have Length Units = End of Bitstream. This means that this field will consume all the bytes up that are left in the input message, and thus you get your variable length field. This way you will not need to worry about BLOB processing, CASTing and RCD nodes. You would just be able to specify the MRM messageSet details in the Input node and deal with an MRM message tree. _________________ Regards
Craig |
|
Back to top |
|
 |
|