       IDENTIFICATION DIVISION.
       PROGRAM-ID. OEFENING12-B.
       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 12B".
               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-titel pic x(10).
               03 o-c-uitvoerder pic x(20).
               03 o-c-prijs pic 9(4).
           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 verder pic x.
               88 verdergoed values "J", "j", "N", "n".
               88 verderstop values "N", "n".


       procedure division.
       hoofdprogramma.
       perform m-o-kopregels
       perform body with test before until eof-cdstatus.
       perform m-o-eindregels
       stop run
               .
       m-o-kopregels.
               display spaces upon crt
               accept datum from date
               move jj to jje
               move mm to mme
               move dd to dde
               add 2000 to jje
               display datume at 0270
               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
               open input cdbestand
               read cdbestand at end continue
               end-read.

       body.
       perform v-c-cdrec-m-o-rec with test before until
               eof-cdstatus
               .

       m-o-eindregels.
               close cdbestand.

       v-c-cdrec-m-o-rec.
               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 1108
               display o-c-uitvoerder at 1138
               display o-c-prijs at 1170
               read cdbestand at end continue
               end-read
               accept toets at 2240.
               exit program.

