IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

numeric edited variables check


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Fri Dec 16, 2005 5:43 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
Search our Forums:

Back to Top