View previous topic :: View next topic
|
Author |
Message |
Nsuma
New User
Joined: 10 Dec 2007 Posts: 13 Location: Hyd
|
|
|
|
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 |
|
|
suny_sn1
New User
Joined: 26 Jun 2007 Posts: 6 Location: India
|
|
|
|
If Count-x is numeric then display “Data is good”
hope this helps |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
|