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 » How to substitute a char with another char ?

Post new topic  Reply to topic
 How to substitute a char with another char ? « View previous topic :: View next topic » 
Author Message
MVO
PostPosted: Tue Apr 23, 2002 10:45 am    Post subject: Reply with quote

Centurion

Joined: 09 Sep 2001
Posts: 131

Hi, I'd like to know if we can substitute a character, say x'7f' with another character, say x'20' whenever an x'7f' is found in the message. I'm using NEON parser (MQSI 2.0.2, DB2 on Solaris) intensively because of the complex nature of my message. NEON has a substitute output operation but it only works if you want to substitute string A with string B, not inside the message body.

Any help will be very appreciated.

Mai Vo
Back to top
View user's profile Send private message
Miriam Kaestner
PostPosted: Fri Apr 26, 2002 2:48 am    Post subject: Reply with quote

Centurion

Joined: 26 Jun 2001
Posts: 103
Location: IBM IT Education Services, Germany

You can do that if you first parse the incoming message as BLOB.
1. In MQInput node defaults, set message domain=BLOB.

2. Then, in a Compute node:
SET OutputRoot=InputRoot;
DECLARE P INTEGER;
SET P=POSITION(x'7f' IN InputBody.BLOB.BLOB);
WHILE 0<P DO
SET OutputRoot.BLOB.BLOB=
OVERLAY(OutputRoot.BLOB.BLOB PLACING x'20' FROM P FOR 2);
SET P=POSITION(x'7f' IN InputBody.BLOB);
END WHILE;

3. In a ResetContentDescriptor node, reparse the message with your NEON input format.

Back to top
View user's profile Send private message Send e-mail
MVO
PostPosted: Fri Apr 26, 2002 4:51 am    Post subject: Reply with quote

Centurion

Joined: 09 Sep 2001
Posts: 131

Thanks Myriam.
Because it's ESQL, your solution is OK for short message but it would be very expensive if we're dealing with large messages. I am looking for something "less expensive" such as a NEON output operation similar to the "Substitute" operation. I guess such function if available will also scan the message but at a smaller cost because it may be written in machine-like (assembler e.g.) code, not ESQL.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Fri Apr 26, 2002 5:28 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Hi,
Just thinking out loud, because I don't know the answer...
Would it be possible to define in NEON a new format that was a repeating single character field? Then you could apply subst on that character field.
Vicky
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 » How to substitute a char with another char ?
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.