Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us