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

49 lines
1.4 KiB
Plaintext
Raw Permalink 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 creates a name and address file. The */
/* data structure for each record is in the %INCLUDE */
/* file RECORD.DCL. */
/*****************************************************/
create:
procedure options(main);
%include 'record.dcl';
%replace
true by '1'b,
false by '0'b;
declare
output file,
filename character(14) varying,
eofile bit(1) static initial(false);
put list ('Name and Address Creation Program, File Name: ');
get list (filename);
open file(output) stream output title(filename);
do while (^eofile);
put skip(3) list('Name: ');
get list(name);
eofile = (name = 'EOF');
if ^eofile then
do;
/* write prompt strings to console */
put list('Address: ');
get list(addr);
put list('City, State, Zip: ');
get list(city, state, zip);
put list('Phone: ');
get list(phone);
/* data in memory, write to output file */
put file(output)
list(name,addr,city,state,zip,phone);
put file(output) skip;
end;
end;
put file(output) skip list('EOF');
put file(output) skip;
end create;