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

55 lines
1.8 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 reads an employee data base and */
/* prints a list of paychecks. */
/******************************************************/
report:
procedure options(main);
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
i fixed,
dashes character(15) static initial
('$--------------'),
buff character(20) varying,
(grosspay, withhold) fixed decimal(7,2),
(repfile, empfile) file;
open file(empfile) keyed environment(f(128),b(4000))
title ('$1.EMP');
open file(repfile) stream print environment(b(2000))
title('$2.$2');
put list('Set Top of Forms, Press Return');
get skip;
do while('1'b);
read file(empfile) into(employee);
if name = 'EOF' then
stop;
put file(repfile) skip(2);
buff = '[' !! name !! ']^m^j';
write file(repfile) from (buff);
grosspay = wage * hours;
withhold = grosspay * .15;
buff = grosspay - withhold;
do i = 1 to 15
while (substr(buff,i,1) = ' ');
end;
i = i - 1;
substr(buff,1,i) = substr(dashes,1,i);
write file (repfile) from(buff);
end;
end report;