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 » REPLACE function

Post new topic  Reply to topic
 REPLACE function « View previous topic :: View next topic » 
Author Message
sirsi
PostPosted: Thu May 18, 2006 9:26 am    Post subject: REPLACE function Reply with quote

Disciple

Joined: 11 Mar 2005
Posts: 177

I want to remove '~~' ( x'7e7e' ) from a blob string. For that i am using
RELACE( <input_blob>, <remove_blob>)

input_blob = blob string
remove_blob = x'7E7E'

My problem is the above REPLACE function is not removing x'7E7E' its actually replacing x'7E7E' with x'00' and x'01' , which are NULL and SOH respectively. Any idea why this is happening?

I am running on WBIMB v5
Back to top
View user's profile Send private message
dsriksha
PostPosted: Thu May 18, 2006 10:06 am    Post subject: Re: REPLACE function Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

We can assume that if Hex values or changing means its an issue with CCSID. So you need a function that can be applied with CCSID. Forgive me if this is not true.

Last edited by dsriksha on Thu May 18, 2006 12:27 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Thu May 18, 2006 10:36 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Post the exact REPLACE statement as it exists in your code.
Back to top
View user's profile Send private message
sirsi
PostPosted: Thu May 18, 2006 11:52 am    Post subject: Reply with quote

Disciple

Joined: 11 Mar 2005
Posts: 177

thanks for the reply guys...
here is the code...
DECLARE remove_blob BLOB X'7E' || X'7E';
SET OutputRoot.BLOB.BLOB = replace(InputRoot.BLOB.BLOB, remove_blob) ;

according to esql pdf:
Quote:
If you do not specify the replace string expression, the replace string defaults to an empty string and the behavior of the function is to delete all occurrences of the search string from the result.


but in my case its not deleting
Back to top
View user's profile Send private message
dsriksha
PostPosted: Thu May 18, 2006 12:31 pm    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

sirsi wrote:
DECLARE remove_blob BLOB X'7E' || X'7E';



Try by modifying above statements with your Input message CCSID.

BTW, dont do any
Code:
SET OutpuRoot= InputRoot or Copy Entire message
Back to top
View user's profile Send private message Send e-mail
sirsi
PostPosted: Thu May 18, 2006 12:59 pm    Post subject: Reply with quote

Disciple

Joined: 11 Mar 2005
Posts: 177

Hi dsriksha,
I tried your method but that also doesnt work. My problem is not with x'7E7E', the REPLACE function is able to identify x'7E7E' properly... but it s not deleting it.

i even tried :-
SET OutputRoot.BLOB.BLOB = replace(InputRoot.BLOB.BLOB, remove_blob,cast('' as blob)) ;
this also gives the same result ( x'0001' )
Back to top
View user's profile Send private message
dilse
PostPosted: Thu May 18, 2006 1:10 pm    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

sirsi,
There is a method with which you can accomplish your task but it may not be effective. Here it is.

Try to convert your BLOB to STRING and then use the REPLACE function and then convert back to BLOB.
Back to top
View user's profile Send private message
sirsi
PostPosted: Thu May 18, 2006 1:14 pm    Post subject: Reply with quote

Disciple

Joined: 11 Mar 2005
Posts: 177

well i thought of this to do... but didnt feel like proper way to do. If REPLACE can take BLOB as input than it should work as mentioned.

Will give a try though.
Back to top
View user's profile Send private message
dilse
PostPosted: Thu May 18, 2006 1:30 pm    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

I suggested this because earlier I used TRIM function on BLOB but it was not working even though I used CCSID on it. So I had to convert it to CHAR and convert back to BLOB.
This is just another way...
Back to top
View user's profile Send private message
sirsi
PostPosted: Thu May 18, 2006 1:35 pm    Post subject: Reply with quote

Disciple

Joined: 11 Mar 2005
Posts: 177

oh Man... got it...
the problem is not with REPLACE function its with my incoming data...
the data sometimes comes with x'0001' and sometimes not... should have checked it out...

sorry for wasting your time guys...

Thanks all for replying
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 » REPLACE function
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.