|
View previous topic :: View next topic
|
| Author |
Message |
Bhagyalakshmi C
New User

Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
Hi,
how to check whether the data type of a variable is numeric.If it is a numeric it has to print "valid data" or else print "invalid data".
how to check this?
Thank you!!! |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Are you using assembler or pl/i?
I believe you want to check the content of some fields for numeric values (rather than trying to check the "type" of the fields). |
|
| Back to top |
|
 |
Bhagyalakshmi C
New User

Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
HI,
Exactaly, the same only.It should check the content of a field whether its numeric or not. I am using PLI.
Thank you!! |
|
| Back to top |
|
 |
Bhagyalakshmi C
New User

Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
Hi,
I myself got the answer.
we can use VERIFY(var1,var2) built in function.
Ex:
var1=6788;
var2=0123456789;
VERIFY(var1,var2) will return 0.
if var1 doesnt contain any character that is in var2 then it returns a non zero value.
Thank you!!!!! |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Thank you for posting your finding  |
|
| Back to top |
|
 |
donateeye
New User
Joined: 01 Jun 2007 Posts: 62 Location: chennai
|
|
|
|
Bhagyalakshmi.... good that you found your answer but.....
Ex:
var1=6788;
var2=0123456789;
VERIFY(var1,var2) will return 0.
if var1 doesnt contain any character that is in var2 then it returns a non zero value.
the explanation you have given is wrong. it goes like this :
if var1 does contain a character which is not in var2 then that function would return a non zero value  |
|
| Back to top |
|
 |
|
|