decimal point



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

decimal point

Postby kartheeswaran » Tue Jan 21, 2014 1:14 am

i want average get floating point value.but didn't get it please help.
You do not have the required permissions to view the files attached to this post.
kartheeswaran
 
Posts: 10
Joined: Fri Dec 27, 2013 12:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: decimal point

Postby tivrfoa » Tue Jan 21, 2014 1:39 am

what's the format are you using for this field?

maybe if you use PIC S99V it works.

http://publib.boulder.ibm.com/iseries/v ... 540313.htm
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: decimal point

Postby kartheeswaran » Tue Jan 21, 2014 1:44 pm

that one not work
i use input file
02 avg pic 99v9

output file
02 averg pic 99v9
kartheeswaran
 
Posts: 10
Joined: Fri Dec 27, 2013 12:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: decimal point

Postby NicC » Tue Jan 21, 2014 2:08 pm

Please do not post attachments - they take up too much space. Simply cut and paste your screen shot and use the code tags to preserve spacing.
What didn't work - please show what you tried and what you got and how it differs from what you want. Simply saying "it does not work" is useless. We know whatever it is that you tried did not work - otherwise you would not be posting.

Remember that a V in your picture specification is an implied decimal point. If you want to actually see the decimal point tyhen you have to specify a real one : 9.9 not 9V9.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
tivrfoa (Tue Jan 21, 2014 3:06 pm)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: decimal point

Postby dgmf » Tue Jan 28, 2014 10:27 am

kartheeswaran wrote:output file
02 averg pic 99v9


You should define this field as 99.9 instead of 99V9

and please do remember that dot will take extra byte.
i.e
99v9 ----->will take 3 bytes
99.9------>will take 4 bytes


Thanks
Dev
dgmf
 
Posts: 7
Joined: Tue Jan 21, 2014 4:18 pm
Location: Bangalore,India
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post