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

To check whether this field contains only zeroes


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
renjithravi

New User


Joined: 28 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Jul 29, 2008 11:01 am
Reply with quote

Hi,

I have a field declared as char(25). But it will will be filled with only numbers from 0 to 9. I want to check whether this field contains only zeroes and do some procesing. How to do this check?

Thanks and regards
Renjith
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 11:23 am
Reply with quote

renjith,

Quote:
I have a field declared as char(25). But it will will be filled with only numbers from 0 to 9.


Will all the 25 bytes be filled with numerals? If yes, you can first use IS NUMERIC and then check the field for zeroes and process accordingly.
Back to top
View user's profile Send private message
renjithravi

New User


Joined: 28 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Jul 29, 2008 11:27 am
Reply with quote

yes all the 25 bytes will be filled with numerals..i can check whether the field is numeric but how to check for zeros?
should i have to hardcode IF A = 25ZEROES or u have any other option like
IF A IS ZEROES?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jul 29, 2008 1:10 pm
Reply with quote

IF A = ALL '0'
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Remove leading zeroes SYNCSORT 4
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top