       IDENTIFICATION DIVISION.
       PROGRAM-ID. OEFENING12-D.
       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.
           select cdeuro
               assign to
               "D:\School\Back-End programmeren\cds.dat"
               organization sequential
               access sequential
               file status euro-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.

           FD cdeuro.
           01 e-eurorecord.
               03 e-nummer pic x(10).
               03 e-titel pic x(10).
               03 e-uitvoerder pic x(20).
               03 e-aantal pic 99.
               03 e-genre pic x(15).
               03 e-prijs pic 9999v99.
               03 e-releasedatum pic 99/99/99.

        working-storage section.

           01 CD-STATUS PIC XX.
               88 eof-cdstatus value "10".
           01 euro-status pic xx.
               88 eof-eurostatus value "10".
           01 i-cdgeg.
               03 i-c-nummer pic x(10).
               03 i-c-titel pic x(10).
               03 i-c-uitvoerder pic x(20).
               03 i-c-aantal pic 99.
               03 i-c-genre pic x(15).
               03 i-c-prijs pic 9(4).
               03 i-c-releasedatum pic 99/99/99.
           01 e-eurogeg.
               03 e-c-nummer pic x(10).
               03 e-c-titel pic x(10).
               03 e-c-uitvoerder pic x(10).
               03 e-c-aantal pic 99.
               03 e-c-genre pic x(15).
               03 e-c-prijs pic 9999v99.
               03 e-c-releasedatum pic 99/99/99.

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

       b-prog.
               open input cdbestand
               open output cdeuro
               read cdbestand at end continue
               end-read
               .
       body.
               perform v-c-cdrecord-m-cdeuro-record with test before
               until eof-cdstatus.
       e-prog.
               close cdbestand
               close cdeuro.
       v-c-cdrecord-m-cdeuro-record.
               compute e-c-prijs = c-prijs/40.3399
               move c-nummer to e-c-nummer
               move c-titel to e-c-titel
               move c-uitvoerder to e-c-uitvoerder
               move c-aantal to e-c-aantal
               move c-genre to e-c-genre
               move c-releasedatum to e-c-releasedatum
               write e-eurorecord from e-eurogeg.
               read cdbestand at end continue
               end-read.
               exit program.

