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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm


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