Guest User

Untitled

a guest
Apr 11th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 2.70 KB | None | 0 0
  1. 000100 IDENTIFICATION DIVISION.
  2. 000200 PROGRAM-ID. Oef6.
  3.        ENVIRONMENT DIVISION.
  4.        INPUT-OUTPUT section.
  5.        file-control.
  6.        Select invoer assign to "oef4_klant"
  7.                 Organization is sequential.
  8.        Select uitvoer assign to "oef4_klant_indexed"
  9.                 Organization is indexed
  10.                 Access mode is random
  11.                 record key is klantid-uit.
  12.        
  13.        DATA DIVISION.
  14.        file section.
  15.        FD invoer.
  16.        01 klant.
  17.     03 klantid        pic x(12).
  18.         03 klantnaam      pic x(25).
  19.         03 bestbedrag     pic 9(6)v9(2).
  20.         03 korting        pic 9(2).
  21.         03 gembedrag      pic 9(6)v9(2).
  22.         03 overbodig      pic 9(12).
  23.         03 aanduiding     pic x(3).
  24.          88 belgisch      value 'BEL'.
  25.          88 europees      value 'EUR'.
  26.          88 nteuropees    value 'INT'.
  27.        FD uitvoer.
  28.        01 klant-uit.
  29.     03 klantid-uit        pic x(12).
  30.         03 klantnaam-uit      pic x(25).
  31.         03 bestbedrag-uit     pic 9(6)v9(2).
  32.         03 korting-uit        pic 9(2).
  33.         03 gembedrag-uit      pic 9(6)v9(2).
  34.         03 overbodig-uit      pic 9(12).
  35.         03 aanduiding-uit     pic x(3).
  36.          88 belgisch-uit      value 'BEL'.
  37.          88 europees-uit      value 'EUR'.
  38.          88 nteuropees-uit    value 'INT'.
  39.        working-storage section.
  40.        01    einde              pic x value '0'.
  41.         88   einde-bestand      value '1'.
  42.        01 pauze                 pic x.
  43.        
  44.        PROCEDURE DIVISION.
  45.        pgm.
  46.        
  47.        open input invoer
  48.        open output uitvoer
  49.        
  50.        Read invoer at end move 1 to einde
  51.        end-read
  52.        
  53.        perform until einde-bestand
  54.                 move klant to klant-uit
  55.                 write klant-uit
  56.                         invalid key display 'ongeldige sleutel'
  57.                                                         klant-uit
  58.                         not invalid key display klant-uit                        
  59.                 end-write
  60.                 read invoer at end move 1 to einde
  61.                 end-read
  62.                 accept pauze
  63.        end-perform      
  64.        close invoer uitvoer  
  65.        
  66.       * perform pgm2    
  67.        stop run.
  68.        
  69.        pgm2.
  70.        open input uitvoer
  71.        
  72.        display 'start pgm2'
  73.        
  74.        move 0 to einde
  75.        Read uitvoer next
  76.          at end move 1 to einde
  77.        end-read
  78.        
  79.        perform until einde-bestand
  80.                 display klant-uit
  81.                 Read uitvoer next
  82.                         at end move 1 to einde
  83.                 end-read
  84.        end-perform
  85.        
  86.        close uitvoer
  87.        
  88.        accept einde
Add Comment
Please, Sign In to add comment