|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to substitute a char with another char ? |
« View previous topic :: View next topic » |
Author |
Message
|
MVO |
Posted: Tue Apr 23, 2002 10:45 am Post subject: |
|
|
 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 |
|
 |
Miriam Kaestner |
Posted: Fri Apr 26, 2002 2:48 am Post subject: |
|
|
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 |
|
 |
MVO |
Posted: Fri Apr 26, 2002 4:51 am Post subject: |
|
|
 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 |
|
 |
vmcgloin |
Posted: Fri Apr 26, 2002 5:28 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|