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

Chapter 4 45
Opening and Closing the File
Opening a New File
Figure 4-3. Opening a New KSAM XL File with FOPEN
type
bit1=0..1;
bit4=0..15;
bit7=0..127;
bit8=0..255;
bit12=0..4095;
bit15=0..32767;
bit16=0..65535;
pac80 = packed array [1..80] of char;
ksam_rec = packed record
case integer of
1 : (bitword : bit16);
2 : (lang_id : bit16);
3 : (resrvd0 : bit8;
select_blk_size;
cm : bit1;
chg_primary : bit1;
kslang : bit1;
ksreuse : bit1;
seq_random : bit1;
rec_numbering : bit1;
resrvd2 : bit1);
4 : (resrvd3 : bit8;
num_keys : bit8);
5 : (key_type : bit4;
key_length : bit12);
6 : (dflag : bit1;
maxkeyblk : bit15);
7 : (resrvd5 : bit8;
rflag : bit1;
resrvd6 : bit7);
8 : (key_location : bit16);
end;
ksam_struc = ARRAY[0..80] OF ksam_rec;
var
file_num : integer;
file_name : pac80;
ksamparam : ksam_struc;
keylocation : bit16;
begin
file_num := 0;
file_name := 'ARMSTR.MGR.AR ';
ksamparam[10].lang_id := 5;
ksamparam[16].resrvd3 := 0;
ksamparam[16].num_keys := 1;
ksamparam[17].key_type := 2;
ksamparam[17].key_length := 5;
keylocation := 5;
ksamparam[18].bitword := keylocation;
file_num:=FOPEN(file_name,6148,1,-80,,ksamparam,,,,100)
end;