HELPLIB.HLB  —  COBOL  PROCEDURE_DIVISION, SUBTRACT
  The SUBTRACT statement subtracts one, or the sum of two or more,
  numeric items from one or more items.  It stores the result in one or
  more items.

1  –  1format FROM

  The SUBTRACT statement subtracts one, or the sum of two or more,
  numeric items from one or more items.  It stores the result in one or
  more items.

  Format 1 -

   SUBTRACT { num } ... FROM { rsult [ ROUNDED ] } ...

      [ ON SIZE ERROR stment ] [ NOT ON SIZE ERROR stment ]

      [ END-SUBTRACT ]

1.1  –  num

  is a numeric literal or the identifier of an elementary numeric item.

1.2  –  rsult

  is the identifier of an elementary numeric item.  It is the resultant
  identifier.

1.3  –  stment

  is an imperative statement.

2  –  2format GIVING

  The SUBTRACT statement subtracts one, or the sum of two or more,
  numeric items from one or more items.  It stores the result in one or
  more items.

  Format 2 -

   SUBTRACT { num } ... FROM num GIVING { rsult [ ROUNDED ] } ...

      [ ON SIZE ERROR stment ] [ NOT ON SIZE ERROR stment ]

      [ END-SUBTRACT ]

2.1  –  num

  is a numeric literal or the identifier of an elementary numeric item.

2.2  –  rsult

  is the identifier of an elementary numeric item or an elementary
  numeric edited item.  It is the resultant identifier.

2.3  –  stment

  is an imperative statement.

3  –  3format CORRESPONDING

  The SUBTRACT statement subtracts one, or the sum of two or more,
  numeric items from one or more items.  It stores the result in one or
  more items.

  Format 3 -

   SUBTRACT { CORRESPONDING } grp-1 FROM grp-2 [ ROUNDED ]
            { CORR          }

      [ ON SIZE ERROR stment ] [ NOT ON SIZE ERROR stment ]

      [ END-SUBTRACT ]

3.1  –  grp

  is the identifier of a group item.

3.2  –  stment

  is an imperative statement.
Close Help