View previous topic :: View next topic
|
Author |
Message |
ajaikumar andy robert Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 23 Location: India
|
|
|
|
hi
i need to convert a field of S9(13)v99 which has a value of -0000000009.00 to a numeric field for the purpose of addition..
i get errors when i try to move this field to an integer directly..
is there any way to convert this easily..
In the file the value is given as -000000000005.0 and i take it as S9(13)v9
pls correct me if i m wrong in this deifinition.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The field you have defined should work as-is in an addition.
COBOL fields that are defined with the "v99" ARE the fields typically used in calculations. The v99 is an "implied" decimal. If the data is excatly
-0000000009.00 the picture S9(13)v99 does not match the data. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Ajai,
How are you 'seeing' the data on file = "-000000000005.0"? is this a display field? If the field on the file is actually "-000000000005.0", then the definition needs to be -9(12).9 This definition cannot be used in addition and must be moved to another field.
Let me know,
Dave |
|
Back to top |
|
|
ajaikumar andy robert Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 23 Location: India
|
|
|
|
hi,
i m not seeing it as "-000000000005.0"...
it is given in the file as -000000000005.0..
it is one of the values i get in the input file..
i need to add the similar values and write them into another file.. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Ajai,
I guess what I'm asking is how do you know it's this value? When I save 'seeing' I mean are you using EDIT or BROWSE, or are you using 'FILE AID' to know the value?
Dave |
|
Back to top |
|
|
ajaikumar andy robert Warnings : 1 New User
Joined: 01 Dec 2006 Posts: 23 Location: India
|
|
|
|
HI
the input comes in a sequential file and i see this value when i open it in edit mode and also in browse mode. even if i used file-aid also the same valus is there.. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Ajay
When you open the dataset in edit mode, are you able to see the "-" sign and the decimal point?????...
Thanks
Arun |
|
Back to top |
|
|
|