IDENTIFICATION DIVISION.
PROGRAM-ID.  Basic7.
DATA DIVISION.
WORKING-STORAGE SECTION.
  TOTAL-VALUE               PIC 99999 VALUE ZERO.
  INPUT-VALUE               PIC 99999 VALUE ZERO.
PROCEDURE DIVISION.
-MAIN.
    PERFORM 0100-LOOP
        UNTIL INPUT-VALUE = 99999.
    DISPLAY ‘The Total is: ‘ TOTAL-VALUE.
    STOP RUN.
-LOOP.
    DISPLAY ‘Enter an Amount to Add (or 99999 if Done): ‘.
    ACCEPT INPUT-VALUE.
    IF INPUT-VALUE NOT NUMERIC
        DISPLAY ‘Amount is NOT a Number, Re-enter’
        MOVE ZERO TO INPUT-VALUE.
    IF INPUT-VALUE NOT = 99999
        ADD INPUT-VALUE TO TOTAL-VALUE
        MOVE ZERO TO INPUT-VALUE.
