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
 

 

numeric edited variables check

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Fri Dec 16, 2005 4:47 pm    Post subject: numeric edited variables check
Reply with quote

hi folks...

is it possible in this case?


if ws-dis-yrly-sal > zeores or numeric


where ws-dis-yrly-sal is defined as z(7).z(2) in working-storage section.

if possible, what happens when there are no values in ws-dis-yrly-sal and in that case it will be space filled....

kind regards,


gowtham
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Dec 16, 2005 5:43 pm    Post subject: Re: numeric edited variables check
Reply with quote

gowtham_1982,

Firstly you cant define IF statement like that... It should be...
Code:
if ws-dis-yrly-sal > zeores or ws-dis-yrly-sal  is numeric


Second If have not passed any data to this variable (also not INITIALIZING) & directly checking for this IF cond...both the conditions will be proved FALSE & IF statement will be FLUSHED or will go in ELSE part.

Regards,

Priyesh.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Dec 19, 2005 2:41 am    Post subject:
Reply with quote

Just one related point. I always found it safer to test for NUMERICs before I tested for a number.

If the field is NOT numeric the number test will abend the pgm. This may not be true for DISPLAY or NUM-ED fields, but I know it is for COMP and COMP-3 fields, and that's why I suggest the orer of the tests above.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


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