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

30 Chapter2
Creating a KSAM File
Building a KSAM File Programmatically
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
ksam_param,
ksamparam : ksam_struc;
keylocation,
reserved : bit16;
.
.
.
begin
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;
.
.
.
The HPFOPEN intrinsic uses item number pairs to identify intrinsic parameters. Item
number 54 is paired with the KSAM parameter array to define the KSAM XL key
structure. Other item number pairs that relate to KSAM XL files specifically are listed
below:
10 This item number identifies the KSAM XL file type. Enter 3 to indicate
that a KSAM XL file is to be created. Enter 7 to indicate that a KSAM64
file is to be created.
17 A KSAM XL file can be accessed only as its own type. Enter 0 for a KSAM
XL file.
The FOPEN intrinsic can also be used to create and open a KSAM file. The same KSAM
parameter array is used as an FOPEN parameter option. The FOPEN intrinsic uses