       IDENTIFICATION DIVISION.
       PROGRAM-ID. FIZZBUZZ.

       ENVIRONMENT DIVISION.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 CURRENT-NUMBER PIC 999.
       01 CURRENT-RESULT PIC X(8).
       
       PROCEDURE DIVISION.
           DISPLAY "FIZZ"

           GOBACK.
       1000-PROCESS-NUMBER SECTION. 
           EVALUATE TRUE
           WHEN CURRENT-NUMBER >= 100
             MOVE "ERROR" TO CURRENT-RESULT
           WHEN FUNCTION MOD (CURRENT-NUMBER, 15) = 0
             MOVE "FIZZBUZZ" TO CURRENT-RESULT
           WHEN FUNCTION MOD (CURRENT-NUMBER, 3) = 0
             MOVE "FIZZ" TO CURRENT-RESULT
           WHEN FUNCTION MOD (CURRENT-NUMBER, 5) = 0
             MOVE "BUZZ" TO CURRENT-RESULT
           WHEN OTHER
             MOVE CURRENT-NUMBER TO CURRENT-RESULT
             INSPECT CURRENT-RESULT REPLACING 
             LEADING "0" BY " "
           END-EVALUATE           
 
           EXIT.
       END PROGRAM FIZZBUZZ.
