Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Extract Data till prev hour balaji81_k DB2 16 Fri Aug 25, 2017 9:25 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us