Author |
Message
|
balu2608 |
Posted: Tue Jan 08, 2013 9:11 am Post subject: Finding the Ascii values for each alphabet in esql |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Hi All,
Can any one help me how can i find the ascii value of each and every alphabet in esql ,is their any function or i have to write any procedure,
my equirement is i will be getting some input values i have chek wheather the values coming in the fields are alphabet or not....
its an urgent requirement ....
thanks in advance... |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 08, 2013 9:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ESQL knows nothing about alphabets.
ESQL only works with CHARACTER data types that are in a specific codepage, CCSID 1200.
An alphabet is not remotely the same thing as a codepage. A code page maps from a set of binary values into characters that belong to an alphabet. |
|
Back to top |
|
 |
balu2608 |
Posted: Tue Jan 08, 2013 9:18 am Post subject: |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
I think we can find the ascii value of the particular alphabet coming and we can ty.... |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Jan 08, 2013 9:28 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
balu2608 wrote: |
I think we can find the ascii value of the particular alphabet coming and we can ty.... |
The mapping node may help you. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
balu2608 |
Posted: Tue Jan 08, 2013 9:30 am Post subject: |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Can you explain me brefly how can i use he mapping node or is their any procedure for finding ascii value of the particular alphabet in esql code |
|
Back to top |
|
 |
McueMart |
Posted: Tue Jan 08, 2013 9:41 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
After reading your first post 3 times im still not 100% sure what you are asking. So im going to take a stab in the dark:
Do you have an input message field such as:
<InputField>ABCDEFGHIJ</InputField>
And you need to test if this is made up of only Alphabetic characters (i.e. a-z A-Z) ?
(Im also thrown by the forum that this is posted to, 'Mainframe, CICS, TXSeries') |
|
Back to top |
|
 |
balu2608 |
Posted: Tue Jan 08, 2013 9:44 am Post subject: And you need to test if this is made up of only Alphabetic c |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Hi McueMart,
Yes ur right ....can you help me... |
|
Back to top |
|
 |
McueMart |
Posted: Tue Jan 08, 2013 9:51 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Well normally I would tell you to go and try some things yourself, but its late in the day so I think something like this should work.
Code: |
IF LENGTH(TRANSLATE(InputString,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')) > 0 THEN
-- STRING CONTAINS NON-ALPHABETIC CHARACTERS
END IF;
|
This is just one way of doing it and there may well be other better ways! |
|
Back to top |
|
 |
balu2608 |
Posted: Tue Jan 08, 2013 9:55 am Post subject: This is just one way of doing it and there may well be other |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Thanks McueMart,
i will try with this ,but Can you suggest me the other ways also... |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 08, 2013 10:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
McueMart wrote: |
(Im also thrown by the forum that this is posted to, 'Mainframe, CICS, TXSeries') |
Moved on the assumption the OP plumped for the first section his mouse went over. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 08, 2013 10:03 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I would typically replace all characters that ARE alphabet characters with a null character and then check the length of the resulting string.
Except, in Broker, I would actually convince the message model to do this validation for me and then make sure the flow asks for the parser to validate the contents and the values. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Jan 08, 2013 10:09 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
balu2608 wrote: |
Can you explain me brefly how can i use he mapping node or is their any procedure for finding ascii value of the particular alphabet in esql code |
Why not give the mapping node a spin and see? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
balu2608 |
Posted: Tue Jan 08, 2013 9:53 pm Post subject: |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Good morning all is their any solution for this..... |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jan 08, 2013 11:34 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
As has been stated the actual byte values for a character depend upon the CCSID/Codepage under which thewy were encoded.
ASCII = American Society for Computer Information Interchange.
This is a very old standard and was originall ony 7 bits (if my memory is correct).
This has been replaced by the ISO standards (8859-x and others) PLUS Unicode & UTF-8 (-16 & -32).
The values of the '#' sign (for example) changes from one CCSID to another.
Please redefine your question after taking into consideration all the information you have been given. If you really want the ASCII Character set values then a simple google for 'ASCII table' comes up with the following URL
http://www.asciitable.com/ _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
balu2608 |
Posted: Wed Jan 09, 2013 1:08 am Post subject: |
|
|
 Apprentice
Joined: 18 May 2012 Posts: 39
|
Thanks smdavies99,
Ur Right ,But ht thing which i need is the
i will be getting some input field same for example
<name>APPLE</name>
i have find the where the value coming in the field is alpha character or not so this i have to implement in esql ,
my thinking is to find the ascii value of the coming input values and thought of finding the wheather it is alphabetic or not ...
can please suggest me in this scenario..... |
|
Back to top |
|
 |
|