file-control.
	select optional klant-file assign to "klant.dat"
	organization indexed
	access mode is dynamic
	record key is klant-prim-key
	alternate record key is klant-alt-key with duplicates
	file status is klant-fs.

file secton.
fd klant-file.
01 klant-record.
	03 klant-keyt.
		05 klant-prim-key.
			07 klant-nr	pic 9(4).
		05 klant-alt-key
			07 klant-naam	pic x(35).
	03 klant-data
		05 klant-wpl		pic x(25).

working storage section.
01 klant-fs				pic xx.



oef1 : lezen via primaire sleutel : bvzoek klant met waarde 27



LEES.
	OPEN INPUT klant-file
	MOVE 27 TO klant-nr
	READ klant-file
		Key is klant-prim-key
		INVALID KEY display "not found bla"
		NOT INVALID KEY	PERFORM VOLGENDE

	END READ
	CLOSE klant-file
	STOP RUN.
VOLGENDE.
	DISPLAY k-rec.	


oef2 : lezen all records via primaire sleutel


lees-alle-prim.
	perform begin-lees-alle-prim
	perform body-lees-alle-prim until klant-eof
	perform eind-lees-alle-prim.

begin-lees-alle-prim.
	open inpput klant-file
	set klant-eof to fasle
	read klantfile next
		at end set klant-eof to true
	end-read.

body-lees-alle-prim.
	display klant-record
	read klant-file next
		at end set klant-eof to true
	end-read.

eind-lees-alle-prim
	close klant-file.





oef3 : lezen via primaire sleutel : vanaf bepaalde sleutel (>100) tot einde

lees-vanaf-prim.
	preform begin-lees-vanaf-prim
	perform eind-lees-vanaf-prim.

begin-lees-vanaf-prim.
	open input klant-file
	set klant-eof to false
	move 100 to klant-nr
	start klant-file key >=klant-prim-key
	invalid key display "fout bij.."
	not invalid key read kland-file next
		at end set klant-eof to true
			end-read
		perform body-lees-vanaf-prim until klant-eof
	end start.

body-lees-vanaf-prim.
	display klant-record
	read klant-file next
		at end set klant-eof to true
	end-read.

eind-lees-vanaf-prim
	close klant-file.