How to display percentage value in the cobol output file



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

How to display percentage value in the cobol output file

Postby rekhamf » Thu Dec 29, 2011 8:42 am

How I can display the percentage value in cobol output file . like = %10.13 ?

Can you please let me know the format of that field to display the percentage value?
rekhamf
 
Posts: 33
Joined: Mon Nov 28, 2011 5:09 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to display percentage value in the cobol output file

Postby dick scherrer » Thu Dec 29, 2011 12:04 pm

Hello,

Can you please let me know the format of that field to display the percentage value
The format of the field is already in the code. It should be a numeric field with an implied decimal place.

Do you understand how to calculate a % in a program?

I would probably calculate the % to the needed "size" (xxx.xxxxxx or whatever), move the calculated value to an edited field for zero suppression and decimal insertion, and pre-pend or append the "%" character.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post