       IDENTIFICATION DIVISION.
       program-id. oefening-13A.
       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 productbestand
               assign to
               "D:\School\Back-End programmeren\product.dat"
               organization sequential
               access sequential
               file status product-status.

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

       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 13A".
               03 lijn-14 pic x(35) value "Product met negatieve bewerki
      -        "ngen".

           01 product-status pic xx.
               88 eof-product-status value "10".
           01 i-prodgeg.
               03 u-p-prodnummer pic x(6).
               03 u-p-prodaard pic x.
                   88 prodaardgoed values "+", "-".
               03 u-p-prodhoev pic 999.
           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 a pic 9999.
           01 b pic 9999.

       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 lijn-11 at 0202
               display lijn-14 at 0520
               display lijn-12 at 2402
               display lijn-13 at 2470
               accept datum from date
               move jj to jje
               move mm to mme
               move dd to dde
               add 2000 to jje
               display datume 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 p-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 p-prodnummer to u-p-prodnummer
               display u-p-prodnummer at a
               move p-prodhoev to u-p-prodhoev
               display u-p-prodhoev at b
               read productbestand at end continue
               end-read
               accept toets at 2178
               add 100 to a
               add 100 to b
               .
               exit program.

