|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Removing ASCII >= 128 |
« View previous topic :: View next topic » |
Author |
Message
|
venky |
Posted: Fri Jun 11, 2004 9:59 am Post subject: Removing ASCII >= 128 |
|
|
 Master
Joined: 08 Jul 2003 Posts: 205
|
Hello All,
In the message flow is it possible to remove or replace character values that are >= 128 ASCII codes with blank ''.
Due to the Oracle 8 bit environment, we are getting these ASCII codes which are >=128.
pls help
Thanks,
Venky
-- |
|
Back to top |
|
 |
Lisa |
Posted: Fri Jun 11, 2004 4:36 pm Post subject: Find |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Hi,
If you are using WMQI 2.1, you will need to find values greater than X with the Position function. Refer to the ESQL manual for help. Once found, you can replace the value with spaces.
You can also use the Case statement.
Just review the manual!
Lisa |
|
Back to top |
|
 |
kirani |
Posted: Sat Jun 12, 2004 10:32 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
But, there is not function in ESQL that will return you ASCII value of a CHAR. _________________ 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 |
|
 |
mgk |
Posted: Thu Jul 08, 2004 3:27 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
In ESQL you can use all the comparison operators (< , >, <=, >=, =, <>, IN, BETWEEN etc) on all character datatypes (bit, blob, char).
This means that you can compare strings of length 1 (i.e. single characters). If you do this then the UNICODE code points for the characters being compared are used for the comparison. Therefore, you do not need to convert a char to it's ASCII value to compare it, just compare it with the character at the codepoint in question.
E.G.
-- is numeric
IF myChar BETWEEN '0' AND '9' THEN ...
DECLARE asc128 CONSTANT CHAR CAST(X'80' AS CHAR CCSID 1208);
-- above ascii 128
IF myChar >= asc128 THEN...
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
kirani |
Posted: Sat Jul 10, 2004 10:57 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
mgk wrote: |
This means that you can compare strings of length 1 (i.e. single characters). |
Can I use this for CHAR Strings? i.e. more than 1 char long string data?
For example,
Code: |
DECLARE str1 CHAR 'AA';
DECLARE str2 CHAR 'AB';
IF ( str1 < str2 ) THEN ...
|
Will this work? _________________ 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 |
|
 |
mgk |
Posted: Sat Jul 10, 2004 1:30 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Yes, you can use all the comparison operators to compare strings of any length. I was just pointing out the behaviour of comparing single char strings. With strings greater than one char you get an alphabetical comparison, with of each char of str1 being compared with its counterpart char in str2.
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
kirani |
Posted: Sat Jul 10, 2004 1:44 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
great! Thanks for the clarification. _________________ 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 |
|
 |
|
|
 |
|
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
|
|
|
|