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
 

 

Validating NUMERIC value with PIC Clause

 
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 Dec 22, 2007 11:18 am    Post subject: Validating NUMERIC value with PIC Clause
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: 788
Location: Chennai, India

PostPosted: Sat Dec 22, 2007 11:29 am    Post subject:
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    Post subject:
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: 788
Location: Chennai, India

PostPosted: Sat Dec 22, 2007 4:26 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Sat Dec 22, 2007 5:20 pm    Post subject: Reply to: Validating NUMERIC value with PIC Clause
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    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 date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
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


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