       IDENTIFICATION DIVISION.
        PROGRAM-ID.oefening-12d.
        AUTHOR.YANNIS-DE-WOLF.
        DATE-WRITTEN.ERGENS-IN-OKTOBER.

       ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.
        SOURCE-COMPUTER.PC.
        OBJECT-COMPUTER.PC.

        Input-output section.
           file-control.
               select cdbestand
               assign to "toeta.dat"
               organization sequential
               access sequential
               file status cd-status.

               select cdeurobestand
               assign to "cdeuro.dat"
               organization sequential
               access sequential
               file status eur-status.

       DATA DIVISION.
        file section.
           FD cdbestand.
           01 c-cdrecord.
               03 c-nummer pic x(5).
               03 c-titel pic x(20).
               03 c-uitvoerder pic x(20).
               03 c-aantal pic 99.
               03 c-genre pic x(15).
               03 c-prijs pic 9(6).
               03 c-releasedatum pic 99/99/99.

           FD cdeurobestand.
           01 e-cdeurorecord.
               03 e-nummer pic x(5).
               03 e-titel pic x(20).
               03 e-uitvoerder pic x(20).
               03 e-aantal pic 99.
               03 e-genre pic x(15).
               03 e-prijs pic 9(6).
               03 e-releasedatum pic 99/99/99.


        WORKING-STORAGE SECTION.
        77 cd-status pic xx.
           88 eof-cd value "10".
        77 eur-status pic xx.
           88 eof-eur value "10".

       procedure division.
       hoofdprogramma.
       perform b-prog
       perform body
       perform e-prog
       stop run
       .

       b-prog.
           open input cdbestand
           open output cdeurobestand
           read cdbestand
           at end set eof-cd to true
           .

       body.
           perform   v-c-cd-record-m-cdeuro-record
           until eof-cd
           .

       v-c-cd-record-m-cdeuro-record.
           divide c-prijs into 40.3399 giving e-prijs
           move c-nummer to e-nummer
           move c-titel to e-titel
           move c-uitvoerder to e-uitvoerder
           move c-aantal to e-aantal
           move c-genre to e-genre
           move c-releasedatum to e-releasedatum

           write e-cdeurorecord end-write

         read cdbestand
           at end set eof-cd to true
         end-read

           .

       e-prog.
           close cdbestand
           close cdeurobestand
           .

