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

CONVERSION OF S9(13)V99 INTO INTEGER


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 05, 2006 1:34 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 05, 2006 2:50 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Dec 05, 2006 7:10 am
Reply with quote

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
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 05, 2006 7:32 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Dec 05, 2006 7:37 am
Reply with quote

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
View user's profile Send private message
ajaikumar andy robert
Warnings : 1

New User


Joined: 01 Dec 2006
Posts: 23
Location: India

PostPosted: Tue Dec 05, 2006 8:22 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Dec 05, 2006 10:17 am
Reply with quote

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
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 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts SMF Record Date conversion failing CLIST & REXX 1
No new posts Assembler class assignment: stuck on ... PL/I & Assembler 12
Search our Forums:

Back to Top