ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Filter node and BLOB

Post new topic  Reply to topic
 Filter node and BLOB « View previous topic :: View next topic » 
Author Message
EvolutionQuest
PostPosted: Thu Mar 11, 2004 8:12 am    Post subject: Filter node and BLOB Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
EddieA
PostPosted: Thu Mar 11, 2004 8:29 am    Post subject: Reply with quote

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
View user's profile Send private message
EvolutionQuest
PostPosted: Thu Mar 11, 2004 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
EddieA
PostPosted: Thu Mar 11, 2004 9:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Missam
PostPosted: Thu Mar 11, 2004 9:11 am    Post subject: Reply with quote

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
View user's profile Send private message
EvolutionQuest
PostPosted: Fri Mar 12, 2004 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Missam
PostPosted: Fri Mar 12, 2004 8:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Filter node and BLOB
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.