|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
CorrelID BLOB conversion... |
« View previous topic :: View next topic » |
Author |
Message
|
waugh |
Posted: Mon Mar 08, 2004 5:08 pm Post subject: CorrelID BLOB conversion... |
|
|
 Master
Joined: 19 Feb 2004 Posts: 225
|
Hello Guys,
i am using following when i set MQMD header in ESQL..
SET OutputRoot.MQMD.CorrelId = CAST((InputRoot.XML.ReservationFindWindowsNegativeAck.MessageId) AS BLOB CCSID 437);
i am getting length did not match exception,
Length of parser field name 'CorrelId' was '10'. It should be '24'.
1) how do i convert length in ESQL?
also at recieving end, there's a C program which now looks for a 10 char. string in correllationId when it performs get.
2) how do i convert a string in C (correlID) to a BLOB and also get the correlID length right?
Thanks In Advance |
|
Back to top |
|
 |
EddieA |
Posted: Mon Mar 08, 2004 7:59 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
You can't cast the CorrelID (or the MessageID) using a CCSID. These fields are BYTE fields, and as such, do NOT convert to characters.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Eyal_Pu |
Posted: Tue Mar 09, 2004 6:57 am Post subject: try the following |
|
|
Newbie
Joined: 05 Nov 2003 Posts: 4
|
if the messageid you want to convert is 48 chars which ontain the msgid (in hex form), just to
MQMD.MsgId = cast(messageid as blob);
if you converted them into chars, and it contains 24 chars, then you can do
MQMD.MsgId = cast(messageid as blob ccsid 850)
ccsid 850 can help you convert from blob to char and in reverse. |
|
Back to top |
|
 |
kirani |
Posted: Tue Mar 09, 2004 7:00 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Waugh,
You need to manually append rest of the CHAR to your CorrelID. Let's say your input field InputRoot.XML.ReservationFindWindowsNegativeAck.MessageId always have 10 char string, then you can use code similar to following to create 24 Byte CorrelID.
Code: |
DECLARE CORLID BLOB;
SET CORLID = CAST (InputRoot.XML.ReservationFindWindowsNegativeAck.MessageId AS BLOB CCSID InputRoot.MQMD.CodedCharSetId);
SET OutputRoot.MQMD.CorrelId = CORLID || X'0000000000000000000000000000';
|
Depending your your requirement you can change the padding HEX to X'40' to get SPACES. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|