Check only ALPHANUMERIC characters
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
Check only ALPHANUMERIC characters
All,
I have to check whether a string contains only alpha numeric characters.
I used ALPHA() Function, but it is not giving the expected result set.
Input file has
"STREAM GSDW NSC D" - Expected Result Set is OK
"STREAM GSDW1 NSC D" - Expected Result Set is FAILED.
As It contains "1".
ALPHA() or ISVALID(String,DSLInk1.columnname) functions are not returning the expected result set.
Note: The data type of the column is varchar(50)
Inputs are welcome!
I have to check whether a string contains only alpha numeric characters.
I used ALPHA() Function, but it is not giving the expected result set.
Input file has
"STREAM GSDW NSC D" - Expected Result Set is OK
"STREAM GSDW1 NSC D" - Expected Result Set is FAILED.
As It contains "1".
ALPHA() or ISVALID(String,DSLInk1.columnname) functions are not returning the expected result set.
Note: The data type of the column is varchar(50)
Inputs are welcome!
Karthik
I believe that AlNum can handle spaces. Excerpt from example for AlNum function.
Examples. If mylink.mystring1 contains the string "OED_75_9*E", then the following function would return the value 0 (false).
AlNum(mylink.mystring1)
If mylink.mystring2 contains the string "12 red roses", then the following function would return the value 1 (true).
AlNum(mylink.mystring2)
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
A quick test is in order. Here are a few input strings and function results from version 11.3.1.2.
Code: Select all
AlNum:1 Alpha:1 STRING:Alpha
AlNum:0 Alpha:0 STRING:Alpha with spaces
AlNum:0 Alpha:0 STRING:Alpha_with_underscores
AlNum:1 Alpha:0 STRING:AlphaNumeric123
AlNum:0 Alpha:0 STRING:Alpha Numeric 123 with spaces
AlNum:0 Alpha:0 STRING:Alpha_Numeric_123_with_underscores
AlNum:1 Alpha:0 STRING:123
AlNum:0 Alpha:0 STRING:1 2 3
AlNum:0 Alpha:0 STRING:1_2_3
Choose a job you love, and you will never have to work a day in your life. - Confucius
Nice test grid! This post ought to be a sticky. THANKS! ; )
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Sounds like a good idea.....how does it work? Never used it. I see the "Favorites" link at the top, but don't see how to target a particular post.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
The option to Add to Favorites is on the far right-hand side of the page, both at the very top and bottom of the page/screen. Clicking it will put a link to the topic in your Favorites so you can get back to it easily.
Last edited by chulett on Wed Sep 30, 2015 8:27 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Cool. Thanks. Never noticed it.
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
If you did a derivation like Alpha(StripWhiteSpace(Col)) and Col=a b c then it should return 1 for true. If the double quotes are actually part of the string as in Col="a b c" the it should return 0 for false. Check the quote character value you have set when reading the file.
Choose a job you love, and you will never have to work a day in your life. - Confucius