dos_compilers/Digital Research PLI-86 v1/ENTER.PLI
2024-06-30 12:01:25 -07:00

62 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/******************************************************/
/* This program constructs a data base of employee */
/* records using a structure declaration. */
/******************************************************/
enter:
procedure options(main);
%replace
true by '1'b,
false by '0'b;
declare
1 employee static,
2 name character(30) varying,
2 address,
3 street character(30) varying,
3 city character(10) varying,
3 state character(12) varying,
3 zip fixed decimal(5),
2 age fixed decimal(3),
2 wage fixed decimal(5,2),
2 hours fixed decimal(5,1);
declare
1 default static,
2 street character(30) varying
initial('(no street)'),
2 city character(10) varying
initial('(no city)'),
2 state character(12) varying
initial('(no state)'),
2 zip fixed decimal(5)
initial(00000);
declare
emp file;
open file(emp) keyed output environment(f(128),b(8000))
title ('$1.EMP');
do while(true);
put list('Employee: ');
get list(name);
if name = 'EOF' then
do;
call write_it();
stop;
end;
address = default;
put list (' Age, Wage: ');
get list (age,wage);
hours = 0;
call write_it();
end;
write_it:
procedure;
write file(emp) from(employee);
end write_it;
end enter;