Author |
Message
|
EvolutionQuest |
Posted: Thu Mar 11, 2004 8:12 am Post subject: Filter node and BLOB |
|
|
 Voyager
Joined: 18 Sep 2001 Posts: 88 Location: Billings, MT
|
When testing for a character or characters in a BLOB within a Filter node can't you do SUBSTRING("Body"."BLOB"."BLOB", FROM 1 FOR 1) = 'T'
I have tried several different permutations and none work. What I want to do of course is if the first byte is a 'T' then go down the true path, otherwise go down the false path.
I have tried doing:
if SUBSTRING("Body"."BLOB"."BLOB", FROM 1 FOR 1) = 'T' then
return true;
else
return false;
end if; |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 11, 2004 8:29 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
'Fraid you have to check it in hex. So that would be '54' in ASCII or 'E3' in EBCDIC.
You "might" be able to check it against 'T' if you CAST the result of the SUBSTRING to CHARACTER, using the CCSID of the Input. (Haven't tried it though ).
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
EvolutionQuest |
Posted: Thu Mar 11, 2004 8:44 am Post subject: |
|
|
 Voyager
Joined: 18 Sep 2001 Posts: 88 Location: Billings, MT
|
You know I was pretty sure I casted that dorn thing, but today is just not my day.
Arg!
IF CAST (Body.BLOB.BLOB[1] AS CHAR) <> 'T' THEN return false; else return true; end if;
Above worked fine. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 11, 2004 9:00 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Chris,
Unless you are 110% certain that the messages will always be in the same 'character set' as where the Broker runs, then I would add the CCSID to the CAST. Otherwise, it you get an EBCDIC mesage in to a Broker running on an ASCII platform, your test will ALWAYS return false.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Missam |
Posted: Thu Mar 11, 2004 9:11 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Code: |
IF CAST (Body.BLOB.BLOB[1] AS CHAR) <> 'T' THEN return false; else return true; end if;
|
How can you be sure that your code CAST (Body.BLOB.BLOB[1] AS CHAR) evaluating fine and routing properly to true terminal.even if the above statement evaluates to NULL it'll be routed to true terminal only.Did u cross check this.
I have tried this on my computer and this code should work for you.
Code: |
if SUBSTRING(CAST(Root.BLOB.BLOB AS CHAR CCSID Root.MQMD.CodedCharSetId) FROM 1 FOR 1) = 'T' then
return true;
else
return false;
end if; |
[/quote] |
|
Back to top |
|
 |
EvolutionQuest |
Posted: Fri Mar 12, 2004 6:02 am Post subject: |
|
|
 Voyager
Joined: 18 Sep 2001 Posts: 88 Location: Billings, MT
|
The simple solution for me was to have a message set that took the BLOB into a string up to the last bitstream. Then all that I needed to do was SUBSTRING() for the first character without having to cast since it was converted into a character base.
It works for me. |
|
Back to top |
|
 |
Missam |
Posted: Fri Mar 12, 2004 8:49 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
I don't think simplest way of handling this is to create a message set and a message and carrying these to where ever environment you move along with the flow.still you need a filter node and IF and SUBSTRING functions to filter your message.a simple CAST statement can save you resources,work and also time. |
|
Back to top |
|
 |
|