       IDENTIFICATION DIVISION.
      ************************.

       PROGRAM-ID. KDUMSATZ.

       ENVIRONMENT DIVISION.
      *********************.

       CONFIGURATION SECTION.
      *---------------------.

       SOURCE-COMPUTER. P3500.
       OBJECT-COMPUTER. P3500.
       
       INPUT-OUTPUT SECTION.
      *--------------------.

       FILE-CONTROL. 
           SELECT KDAT ASSIGN TO INPUT "UMSATZ".
           SELECT LISTE ASSIGN TO PRINT "PRINTER".

       DATA DIVISION.
      **************.

       FILE SECTION.
      *------------.

       FD  KDAT LABEL RECORD IS STANDARD.
       01  KSATZ.
           05 KSA                      PIC 9.
           05 KNR                      PIC 9(7).
           05 KUMSJAHR                 PIC 99.
           05 KUMS                     PIC 9(10)V99.
           05 KLIMIT                   PIC 9(5).
       FD  LISTE LABEL RECORD IS OMITTED.
       01  LIST-SATZ                   PIC X(80). 
                                       
       WORKING-STORAGE SECTION.
      *-----------------------.
       01  KLSATZ.
           05 FILLER                   PIC X(10) VALUE SPACES.
           05 KLNR                     PIC 9(7).
           05 FILLER                   PIC X(4) VALUE SPACES.
           05 KLUMS                    PIC ZZZZZZZZZ9.99.
           05 FILLER                   PIC X(46) VALUE SPACES.
       01  KOZ.
           05 FILLER                   PIC X(25).
           05 UESCHRIFT  PIC X(27) VALUE "K U N D E N U M S A E T Z E".   
 	   05 FILLER                   PIC X(18).                              
           05 SEIT                     PIC X(5) VALUE "SEITE". 
           05 FILLER                   PIC X.
           05 DSEITE                   PIC 99 VALUE 1.
           05 FILLER                   PIC XX.
       01  UEZ.
           05 FILLER                   PIC X(10).
           05 DNR                      PIC X(7) VALUE "KUNDENR".
           05 FILLER                   PIC X(6).
           05 DUMS                     PIC X(12) VALUE "KUNDENUMSATZ".
           05 FILLER                   PIC X(45).
       01  SEIZAE                      PIC 99 VALUE 1.
       01  ZEIZAE                      PIC 99 VALUE ZERO.

       PROCEDURE DIVISION.
      *******************.

       ANF.
           OPEN INPUT KDAT , OUTPUT LISTE.
           MOVE SPACES TO LIST-SATZ.
           WRITE LIST-SATZ FROM KOZ.
           MOVE SPACES TO LIST-SATZ.
           WRITE LIST-SATZ FROM UEZ AFTER 5 LINES.
       ANF1.
           MOVE SPACES TO KLSATZ.
       ANF2.
           READ KDAT AT END GO TO EOF.
           IF KSA NOT = 1 GO TO ANF2.                                 
           IF KUMS NOT > 100000.00 GO TO ANF2.
           IF KUMSJAHR NOT = 82 GO TO ANF2.
           MOVE KNR TO KLNR.
           MOVE KUMS TO KLUMS.
           MOVE SPACES TO LIST-SATZ.
           WRITE LIST-SATZ FROM KLSATZ.
           ADD 1 TO ZEIZAE.
           IF ZEIZAE NOT = 50 GO TO ANF1.
           ADD 1 TO SEIZAE.
           MOVE SEIZAE TO DSEITE.
           MOVE SPACES TO LIST-SATZ.
           WRITE LIST-SATZ FROM KOZ AFTER ADVANCING PAGE.
           MOVE SPACES TO LIST-SATZ.
           WRITE LIST-SATZ FROM UEZ AFTER 5 LINES.
           MOVE ZEROS TO ZEIZAE.
           GO TO ANF1.
       EOF.
           CLOSE KDAT , LISTE.
           STOP RUN.
