Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Oplossing opgave 7.
- Opgave 7A.
- IDENTIFICATION DIVISION.
- PROGRAM-ID. oef7a_1011.
- environment division.
- input-output section.
- file-control.
- select artiesten assign "artiesten.dat"
- organization is indexed
- access is random
- record key is boekingscode.
- select wijzigingen assign "wijziging.txt".
- data division.
- file section.
- fd wijzigingen.
- 01 wijzig-rec.
- 02 wijzig-code pic x(10).
- 02 wijzig-prijs pic s9(5)v99 sign leading separate.
- fd artiesten.
- copy copy-artiesten-rec.
- working-storage section.
- 01 prijs-ed pic z(7).zz.
- 01 toets pic x.
- 88 niet-gevonden value high-values.
- procedure division.
- pgm.
- open input wijzigingen artiesten
- read wijzigingen
- at end display "geen wijzigingen"
- set einde-bestand to true
- end-read
- perform until einde-bestand
- move wijzig-code to boekingscode
- move low-values to toets
- read artiesten
- invalid key
- move high-values to toets
- display "boekingscode " wijzig-code " bestaat niet"
- end-read
- if not niet-gevonden
- move boekingsprijs to prijs-ed
- add wijzig-prijs to boekingsprijs
- rewrite artiesten-rec
- invalid key display "wijziging niet doorgevoerd"
- not invalid key
- display "boekingsprijs " wijzig-code " gewijzigd"
- display "oud: " prijs-ed
- move boekingsprijs to prijs-ed
- display "nieuw: " prijs-ed
- end-rewrite
- end-if
- read wijzigingen
- at end display "einde wijzigingen"
- set einde-bestand to true
- end-read
- end-perform
- accept toets.
- einde.
- close wijzigingen artiesten
- stop run.
- 01 artiesten-rec.
- 88 einde-bestand value high-values.
- 02 boekingscode.
- 04 boek-eerstechar pic x(1).
- 04 boek-rest pic x(9).
- 02 naam pic x(20).
- 02 boekingsprijs pic 9(5)v99.
- 02 genre pic x(10).
- 02 land pic x(3).
- Opgave 7B.
- IDENTIFICATION DIVISION.
- PROGRAM-ID. oef7b_1011.
- environment division.
- configuration section.
- special-names.
- decimal-point is comma
- currency sign is "E".
- input-output section.
- file-control.
- select artiesten assign "artiesten.dat"
- organization is indexed
- access is sequential
- record key is boekingscode.
- select uitvoer assign "uitvoer-oef7.txt"
- organization is line sequential.
- data division.
- file section.
- fd uitvoer.
- 01 u-rec.
- 02 pic x(10).
- 02 u-titel.
- 03 u-code pic x(10)b.
- 03 u-artiest pic x(20)b.
- 03 u-land pic x(3)b.
- 03 u-prijs pic EEEE.E(3),99.
- fd artiesten.
- copy copy-artiesten-rec.
- working-storage section.
- 01 toets pic x.
- procedure division.
- pgm.
- open input artiesten output uitvoer
- read artiesten
- at end display "geen artiesten"
- set einde-bestand to true
- not at end
- move "overzicht boekingsprijs per artiest in 2011"
- to u-titel
- write u-rec
- move all "_" to u-titel
- write u-rec
- move spaces to u-titel
- write u-rec
- end-read
- perform until einde-bestand
- move boekingscode to u-code
- move naam to u-artiest
- move land to u-land
- move boekingsprijs to u-prijs
- write u-rec
- read artiesten
- at end display "einde artiestenbestand"
- set einde-bestand to true
- end-read
- end-perform
- accept toets
- einde.
- close artiesten
- stop run.
Add Comment
Please, Sign In to add comment