Working with numbers and arithmetic

In general, you can view COBOL numeric data as a series of decimal digit positions. However, numeric items can also have special properties such as an arithmetic sign or a currency sign.

To define, display, and store numeric data so that you can perform arithmetic operations efficiently:

  • Use the PICTURE clause and the characters 9, +, -, P, S, and V to define numeric data.
  • Use the PICTURE clause and editing characters (such as Z, comma, and period) along with MOVE and DISPLAY statements to display numeric data.
  • Use the USAGE clause with various formats to control how numeric data is stored.
  • Use the numeric class test to validate that data values are appropriate.
  • Use ADD, SUBTRACT, MULTIPLY, DIVIDE, and COMPUTE statements to perform arithmetic.
  • Use the CURRENCY SIGN clause and appropriate PICTURE characters to designate the currency you want.