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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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