       IDENTIFICATION DIVISION.
       program-id. oefening-13.
       author. coppens bart.
       date-written. 05-november-2003.

       environment division.
        configuration section.
         source-computer. pc.
         object-computer. pc.
       input-output section.
       file-control.
           select productbestand
               assign to
               "c:\product.dat"
               organization sequential
               access sequential
               file status product-status.

       DATA DIVISION.
        file section.
           fd productbestand.
           01 a-productrecord.
               03 c-prodnummer pic x(6).
               03 c-prodaard pic x.
               03 c-prodhoev pic 999.

       WORKING-STORAGE SECTION.
           01 product-status pic xx.
               88 eof-product-status value "10".
           01 i-prodgeg.
               03 i-c-prodnummer pic x(6).
               03 i-c-prodaard pic x.
                   88 prodaardgoed values "+", "-".
               03 i-c-prodhoev pic 999.
           01 datum.
               03 jj pic 99.
               03 mm pic 99.
               03 dd pic 99.
           01 datum-e.
               03 dde pic 99.
               03 slash pic x value "/".
               03 mme pic 99.
               03 slash pic x value "/".
               03 jje pic 9999.
           01 verder pic x.
               88 verdergoed values "J", "j", "N", "n".
               88 verderstop values "n", "N".

       SCREEN SECTION.
       COPY "C:\OEF13.ss".

       PROCEDURE DIVISION.

           perform bprog
           perform body with test before until verderstop
           perform eprog
           stop run
           .


           bprog.
               open extend productbestand.


           body.
               perform vrecord.

           eprog.
               close productbestand.


               vrecord.
                   initialize i-c-prodnummer
                   initialize i-c-prodaard
                   initialize i-c-prodhoev
                   initialize verder
                   display spaces upon crt
                   DISPLAY G-OEF13
                   accept datum from date
                   move jj to jje
                   move mm to mme
                   move dd to dde
                   add 2000 to jje
                   display datum-e at 0270
                   accept i-c-prodnummer at 0825
                   accept i-c-prodaard at 0837
                       perform with test before until prodaardgoed
                           display "foute keuze" at 1030
                           accept i-c-prodaard at 0837
                       end-perform
                   display "           " at 1030
                   accept i-c-prodhoev at 0846
                   write a-productrecord from i-prodgeg
                   accept verder at 1956
                       perform with test before until verdergoed
                           display "foute keuze" at 2035
                           accept verder at 1956
                       end-perform
                   display "           " at 2035.
