       IDENTIFICATION DIVISION.
       PROGRAM-ID. OEFENING12-C.
       AUTHOR. Levy De Vos.
       DATE-WRITTEN. 03-november-04.

       ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.
         SOURCE-COMPUTER. PC.
         OBJECT-COMPUTER. PC.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT CDBESTAND
               ASSIGN TO
               "D:\School\Back-End programmeren\cds.dat"
               organization sequential
               access sequential
               file status cd-status.

       DATA DIVISION.
        FILE SECTION.
           FD CDbestand.
           01 C-CDrecord.
               03 c-nummer PIC x(10).
               03 c-titel pic x(10).
               03 c-uitvoerder pic x(20).
               03 c-aantal pic 99.
               03 c-genre pic x(15).
               03 c-prijs pic 9(4).
               03 c-releasedatum pic 99/99/99.

        working-storage section.
           01 scherm-1.
               03 lijn-11 pic x(15) value "HOGESCHOOL Gent".
               03 lijn-12 pic x(12) value "Levy De VOs".
               03 lijn-13 pic x(11) value "Opgave 12C".
               03 lijn-14 pic x(10) value "LIJST CD'S".
               03 lijn-15 pic x(6) value "TITEL".
               03 lijn-16 pic x(11) value "UITVOERDER".
               03 lijn-17 pic x(5) value "PRIJS".
               03 lijn-18 pic x(22) value "Druk op een toets...".
           01 CD-STATUS PIC XX.
               88 eof-cdstatus value "10".
           01 o-regel.
               03 o-c-nummer pic x(10).
               03 o-c-titel pic x(10).
               03 o-c-uitvoerder pic x(20).
               03 o-c-aantal pic 99.
               03 o-c-genre pic x(15).
               03 o-c-prijs pic 9(4).
               03 o-c-releasedatum pic 99/99/99.
           01 datum.
               03 jj pic 99.
               03 mm pic 99.
               03 dd pic 99.
           01 datume.
               03 dde pic 99.
               03 slash pic x value "/".
               03 mme pic 99.
               03 slash pic x value "/".
               03 jje pic 9999.
           01 toets pic x.
           01 teller pic 99.
           01 pos1 pic 9999.
           01 pos2 pic 9999.
           01 pos3 pic 9999.

       procedure division.
       hoofdprogramma.
       perform b-prog
       perform groep-body
       perform e-prog
       stop run
               .
       b-prog.
               open input cdbestand
               read cdbestand at end continue
               end-read.
       groep-body.
               perform v-cdgroep-v-toets-m-o-scherm with test before
               until eof-cdstatus
               .
       v-cdgroep-v-toets-m-o-scherm.
               perform m-o-scherm-v-toets
               perform m-o-body.
       e-prog.
               close cdbestand.
       m-o-scherm-v-toets.
               display spaces upon crt
               display lijn-11 at 0202
               display lijn-12 at 2402
               display lijn-13 at 2470
               display lijn-14 at 0536
               display lijn-15 at 0910
               display lijn-16 at 0940
               display lijn-17 at 0968
               display lijn-18 at 2202
               accept datum from date
               move jj to jje
               move mm to mme
               move dd to dde
               add 2000 to jje
               display datume at 0270
               move 1 to teller.
       m-o-body.
               move 1109 to pos1
               move 1137 to pos2
               move 1170 to pos3
       perform v-c-cdrecord-m-o-regel with test before until
               (eof-cdstatus or (teller >= 10))

               accept toets at 2440.
       v-c-cdrecord-m-o-regel.
               move c-titel to o-c-titel
               move c-uitvoerder to o-c-uitvoerder
               move c-prijs to o-c-prijs
               display o-c-titel at pos1
               display o-c-uitvoerder at pos2
               display o-c-prijs at pos3
               add 1 to teller
               read cdbestand at end continue
               end-read
               add 100 to pos1
               add 100 to pos2
               add 100 to pos3.
               exit program.

