How to print decimal points in cobol?

I want the data to be in coil decimal format. How to print data with decimal points. I used

Pic 99v99

      

for my data definition, but it doesn't show the decimal point in the result when I do DISPLAY

it.

12.34

for my data value is displayed as 1234

+3


source to share


1 answer


V

in 99V99

is just an "invisible" decimal point that sets the correct alignment for any fixed point operations. This has the advantage of not requiring additional memory. If you want the displayed comma to use PIC

-clause as 99.99

that would

  • take another byte
  • only works with USAGE DISPLAY

    , not COMP

    -fields


Note. When using, DECIMAL-POINT IS COMMA

you need to change PIC

-clause accordingly to:PIC 99,99

+4


source







All Articles