 IDENTIFICATION DIVISION.
PROGRAM-ID. FIZZBUZZ.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CT PIC 999 VALUE 1.
01 CT2 PIC 99 VALUE 1.
01 CT1 PIC 9 VALUE 1.
01 FZ PIC 999 VALUE 1.
01 BZ PIC 999 VALUE 1.
PROCEDURE DIVISION.
PERFORM 100 TIMES
EVALUATE FZ ALSO BZ
WHEN 3 ALSO 5   DISPLAY "FizzBuzz"
MOVE 0 TO FZ
MOVE 0 TO BZ
WHEN 3 ALSO ANY DISPLAY "Fizz"
MOVE 0 TO FZ
WHEN ANY ALSO 5 DISPLAY "Buzz"
MOVE 0 TO BZ
WHEN OTHER EVALUATE CT
WHEN 1 THRU 9   MOVE CT TO CT1
DISPLAY CT1
WHEN 10 THRU 99 MOVE CT TO CT2
DISPLAY CT2
WHEN OTHER      DISPLAY CT
END-EVALUATE
END-EVALUATE
ADD 1 TO CT
ADD 1 TO FZ
ADD 1 TO BZ
END-PERFORM
STOP RUN.
