Using KSAM/XL and KSAM 64 (32650-90886)

40 Chapter4
Opening and Closing the File
Opening an Existing KSAM File
Figure 4-1. Opening an Existing KSAM File with HPFOPEN
procedure open_permanent_KSAM_file;
const
formal_designator_option = 2;
domain_option = 3;
access_type_option = 11;
dynamic_locking_option = 12;
exclusive_option = 13;
ASCII_binary_option = 53;
type
pac160 = packed array [1..160] of char;
var
file_num : integer;
status : integer;
file_name : pac160;
permanent : integer;
update : integer;
lockable : integer;
shared : integer;
ascii : integer;
begin
file_num := 0;
status := 0;
file_name := ’%ARMSTR.MGR.AR%’
permanent := 1;
update := 5;
lockable := 1;
shared := 3;
ascii := 1;
HPFOPEN(file_num, status,
formal_designator_option, file_name,
domain_option, permanent,
access_type_option, update,
dynamic_locking_option, lockable,
exclusive_option, shared,
ASCII_binary_option, ascii
);
if status <> 0 then handle_file_error (file_num, status);
end;