SUBTRACT statement

Other topics

Remarks:

The SUBTRACT statement is used to subtract one, or the sum of two or more, numeric data items from one or more items, and set the values of one or more identifiers to the result.

SUBTRACT statement syntax diagram

rounded-phrase

enter image description here

SUBTRACT example

SUBTRACT item-a item-b item-c FROM account-z ROUNDED MODE IS NEAREST-EVEN
    ON SIZE ERROR
        DISPLAY "CALL THE BOSS, Account `Z` is OUT OF MONEY" END-DISPLAY
        PERFORM promisary-processing
    NOT ON SIZE ERROR
        PERFORM normal-processing
END-SUBTRACT

Contributors

Topic Id: 7465

Example Ids: 24669

This site is not affiliated with any of the contributors.