Author |
Message
|
Lisa |
Posted: Thu Sep 25, 2003 6:46 am Post subject: Special characters |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
All,
What's the best way to filter out special characters that are incompatible with international telex in SWIFT messages?
The characters are & * ; <> " !. and so on. The characters can be inbedded in free form text up to 50 bytes long.
Lisa |
|
Back to top |
|
 |
kirani |
Posted: Thu Sep 25, 2003 4:44 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Do you want to replace these characters with SPACE?
I guess, you have to write some kind of function in ESQL to loop thru complete char string and search for special characters one by one. If no special char is found then you would append that char to new string, which will be returned to the caller at the end of the function. You can use a combination of POSITION and OVERLAY functions within your code.
In WBIMB they have REPLACE Function, which can help. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
fitzcaraldo |
Posted: Thu Sep 25, 2003 6:52 pm Post subject: |
|
|
Voyager
Joined: 05 May 2003 Posts: 98
|
FYI - this works:
Code: |
-- build the incoming message into a blob string
declare xmlBodyRef reference to InputRoot.XML;
declare xmlBody blob cast('' as blob);
move xmlBodyRef firstchild;
while lastmove(xmlBodyRef) = true do
set xmlBody = xmlBody || BITSTREAM(xmlBodyRef);
move xmlBodyRef nextsibling;
end while;
-- xmlBody should now hold all elements of the message
-- copy it to the messageData field
set OutputRoot.XML.MyMessage.messageData.(XML.Content) = cast (xmlBody
as CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
|
|
|
Back to top |
|
 |
fitzcaraldo |
Posted: Thu Sep 25, 2003 6:56 pm Post subject: |
|
|
Voyager
Joined: 05 May 2003 Posts: 98
|
oops - sorry - posted to wrong topic! |
|
Back to top |
|
 |
Lisa |
Posted: Fri Sep 26, 2003 9:10 am Post subject: Special Char |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Thanks Kirani,
I started coding the routine yesterday and I am using the Position and Overlay functions as mentioned in your posting.
Lisa |
|
Back to top |
|
 |
pankajg |
Posted: Wed Oct 22, 2003 8:35 am Post subject: |
|
|
Acolyte
Joined: 11 Oct 2001 Posts: 53
|
Lisa - If it is not a problem , Can you share the Routine , you have coded.
I may reuse it to replace NULL / "Registered Trademark" char with SPACE. _________________ Regards
Pankaj |
|
Back to top |
|
 |
Lisa |
Posted: Wed Oct 22, 2003 1:18 pm Post subject: Spec. |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
pankajg,
Check your email.
Regards, Lisa |
|
Back to top |
|
 |
|