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
 
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

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