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 Validation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Nsuma

New User


Joined: 10 Dec 2007
Posts: 13
Location: Hyd

PostPosted: Sat Jan 05, 2008 12:55 pm    Post subject: Numeric Validation
Reply with quote

Hi All,
I have to read the numeric value number by number to check is the valid numeric value or not.My numeric value pic clause is 9(5)v99 , the value from the file will be vary ...means it may be 1234, 1234567, 12, ab1234 or a123.......like this...so how to check the field is numeric or not by checking each position in the field basing on the size.
Back to top
View user's profile Send private message

suny_sn1

New User


Joined: 26 Jun 2007
Posts: 6
Location: India

PostPosted: Sat Jan 05, 2008 1:32 pm    Post subject:
Reply with quote

If Count-x is numeric then display “Data is good”

hope this helps
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Sat Jan 05, 2008 5:35 pm    Post subject:
Reply with quote

Nsuma,

Quote:
My numeric value pic clause is 9(5)v99 , the value from the file will be vary ...means it may be 1234, 1234567, 12, ab1234 or a123.......like this...

First question, if you have declared var as number (as shown above).... how are you getting 'ab1234' value?????????


so how to check the field is numeric or not by checking each position in the field basing on the size.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Sat Jan 05, 2008 5:36 pm    Post subject:
Reply with quote

Sorry about my prev post. Pressed submit button in hurry.


Nsuma,

Quote:
My numeric value pic clause is 9(5)v99 , the value from the file will be vary ...means it may be 1234, 1234567, 12, ab1234 or a123.......like this...

First question, if you have declared var as number (as shown above).... how are you getting 'ab1234' value?????????


Quote:
so how to check the field is numeric or not by checking each position in the field basing on the size.

Ans to your question, use 'class condition'. For syntax and usage, go thru cobol manuals.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jan 05, 2008 6:28 pm    Post subject:
Reply with quote

Hi Murali,

If the defined numeric var is part of a record read into an 01 group level var the numeric var could very well contain a blank in error. It could have been defined as an A/N var when it was originally created.

There are other variations on this scenerio, but this is probably the most likely.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Sat Jan 05, 2008 8:14 pm    Post subject:
Reply with quote

Jack,

Quote:
If the defined numeric var is part of a record read into an 01 group level var the numeric var could very well contain a blank in error.

I agree with your statement.

Quote:
It could have been defined as an A/N var when it was originally created.

Only thing I can think is - BAD DESIGN (could be initial or changed one).
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 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
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm

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