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

56 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 reads a name and address data file */
/* and displays the information on request. */
/******************************************************/
retrieve:
procedure options(main);
%include 'record.dcl';
%replace
true by '1'b,
false by '0'b;
declare
(sysprint, input) file,
filename character(14) varying,
(lower, upper) character(30) varying,
eofile bit(1);
open file(sysprint) print title('$con');
put list('Name and Address Retrieval, File Name: ');
get list(filename);
do while(true);
lower = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
upper = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
put skip(2) list('Type Lower, Upper Bounds: ');
get list(lower,upper);
if lower = 'EOF' then
stop;
open file(input) stream input environment(b(1024))
title(filename);
eofile = false;
do while (^eofile);
get file(input) list(name);
eofile = (name = 'EOF');
if ^eofile then
do;
get file(input)
list(addr,city,state,zip,phone);
if name >= lower & name <= upper then
do;
put page skip(3)list(name);
put skip list(addr);
put skip list(city,state);
put skip list(zip);
put skip list(phone);
end;
end;
end;
close file(input);
end;
end retrieve;