Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to check the data type of a variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: how to check the data type of a variable
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

Site Director


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

PostPosted: Wed Aug 01, 2007 8:03 pm    Post subject:
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    Post subject:
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    Post subject: Re: how to check the data type of a variable
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

Site Director


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

PostPosted: Fri Aug 03, 2007 6:01 pm    Post subject:
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    Post subject: Reply to: how to check the data type of a variable
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 16 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us