Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

COBOL Programming :: RE: ROUNDED Problem with COMPUTE statement

$
0
0
Author: Terry Heinze
Posted: Thu Feb 09, 2017 9:36 pm (GMT 5.5)

Hint:
When I calculate a percentage, I use the following:
Code:
05  ws-size  pic s999  comp-3.
05  ws-max   pic s999  comp-3.
05  ws-part  pic s9v99 comp-3.
05  ws-pct   pic  zz9.
divide ws-size by ws-max giving ws-part rounded
multiply 100 by ws-part giving ws-pct

Hope this helps.
_________________
.... Terry


Viewing all articles
Browse latest Browse all 8500

Trending Articles