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

Validating NUMERIC value with PIC Clause


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

New User


Joined: 10 Dec 2007
Posts: 13
Location: Hyd

PostPosted: Sat Dec 22, 2007 11:18 am
Reply with quote

HI ALL,
In my application I have one rate-filed,
From the file some times I am getting value as some 19.24
But when I validate the rate-filed with is numeric clause it is giving not numeric result, but this rate is valid for my application, how to take this rate-filed is valid at this rate (19.24) in this situation.
Pic clause of rate-field is s9(10)v99.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Sat Dec 22, 2007 11:29 am
Reply with quote

Nsuma,

Since PIC clause of rate-field is S9(10)V99, the value in the file should be 000000001924. V indicates that it's assumed decimal point.

Do correct me if I don't understand your problem.
Back to top
View user's profile Send private message
Nsuma

New User


Joined: 10 Dec 2007
Posts: 13
Location: Hyd

PostPosted: Sat Dec 22, 2007 11:52 am
Reply with quote

HI gnanas,

Some times i am getting rate value from the client 19.24 instead of 1924.but these two values are valid for me as per requirement,but when i am checking 19.24 is numeric,it is giving not numeric result,but how can make the 19.24 as valid numeric...is there any possilblity to validate as numeric ...please let me know
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Sat Dec 22, 2007 4:26 pm
Reply with quote

Nsuma,

Quote:
Some times i am getting rate value from the client 19.24 instead of 1924.


Are you getting the value from file?

Is it okay to give two type of values(19.24 or 1924) for the same field?
Doesn't it make problem while reading the file?

Do correct me if I am wrong.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Dec 22, 2007 5:20 pm
Reply with quote

It looks like there is a lot of confusion about data conversion,validation...

every shop should have standards and STRONG suggestions on how to deal
with fields which are not program generated...

let' s suppose that the data comes thru a field in a cics map..

1) the field is defined as a generic field ( NO num, justify, fill subparameters )
then it is the application responsibility to validate each char as acceptable,
and convert the field to the to the desired format...
( a field can be entered in free format )

2 the field is defined as NUMERIC, ZERO FILLED, RIGHT JUSTIFIED
( look at the cics manual for the assumptions and mix )
then after a receive map, You will be certain that the field is numeric,
the only drawback of this approach is that the end user will have always to enter
the digits implied after the decimal comma/point
( but without physically entering the decimal separator )


I alway wonder why so many posters ask abut this issue...

ALL the shops were I worked had, or I forced them to have,
a STANDARD numeric validation and conversion routine
with different degrees of sophystication, but still a standard one,
with even a default message standardized across the applications

simple effective, no need to reinvent the wheel each time
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top