View previous topic :: View next topic
|
Author |
Message |
gowtham_1982 Warnings : 1 Active User
Joined: 02 Dec 2005 Posts: 109
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
|