dos_compilers/Digital Research PLI-86 v1/KEYFILE.PLI

33 lines
896 B
Plaintext
Raw Normal View History

2024-06-30 21:01:25 +02:00
/******************************************************/
/* This program reads an employee record file and */
/* creates another file of keys to access the records.*/
/******************************************************/
keyfile:
procedure options(main);
declare
1 employee static,
2 name character(30) varying;
declare
(input, keys) file,
k fixed;
open file(input) keyed environment(f(128),b(10000))
title('$1.emp');
open file(keys) stream output
linesize (60) title('$1.key');
do while('1');
read file(input) into(employee) keyto(k);
put skip list(k,name);
put file(keys) list(name,k);
if name = 'EOF' then
stop;
end;
end keyfile;