IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to check the data type of a variable


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bhagyalakshmi C

New User


Joined: 24 Jul 2007
Posts: 38
Location: Bangalore

PostPosted: Wed Aug 01, 2007 7:28 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 01, 2007 8:03 pm
Reply with quote

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
View user's profile Send private message
Bhagyalakshmi C

New User


Joined: 24 Jul 2007
Posts: 38
Location: Bangalore

PostPosted: Thu Aug 02, 2007 11:28 am
Reply with quote

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
View user's profile Send private message
Bhagyalakshmi C

New User


Joined: 24 Jul 2007
Posts: 38
Location: Bangalore

PostPosted: Fri Aug 03, 2007 12:02 pm
Reply with quote

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.
icon_biggrin.gif

Thank you!!!!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 6:01 pm
Reply with quote

Thank you for posting your finding icon_smile.gif
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Mon Dec 17, 2007 5:59 pm
Reply with quote

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 icon_rolleyes.gif :

if var1 does contain a character which is not in var2 then that function would return a non zero value icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top