       IDENTIFICATION DIVISION.
       program-id. oefening-13A.
       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 c-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 toets pic x.
           01 a pic 9999.
           01 b pic 9999.

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

       PROCEDURE DIVISION.

           perform m-o-titels
           perform m-o-body
           perform e-prog
           stop run
           .


           m-o-titels.
               open input productbestand
               read productbestand at end continue
               end-read
               display spaces upon crt
               display g-oef13a
               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
               move 1107 to a
               move 1144 to b.

           m-o-body.
               perform v-p-productrecord with test before until
               eof-product-status
               .

           e-prog.
               close productbestand.


           v-p-productrecord.

               if c-prodaard = "+"
                   then perform v-p-rec-pos
                   else perform v-p-rec-neg-m-o-regel
               end-if.


           v-p-rec-pos.
               read productbestand at end continue
               end-read.

           v-p-rec-neg-m-o-regel.
               move c-prodnummer to i-c-prodnummer
               display i-c-prodnummer at a
               move c-prodhoev to i-c-prodhoev
               display i-c-prodhoev at b
               read productbestand at end continue
               end-read
               accept toets at 2178
               add 100 to a
               add 100 to b
               .
