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

Chapter 2 29
Creating a KSAM File
Building a KSAM File Programmatically
1 Byte key (1 to 255 bytes)
2 Short integer key (255 bytes)
3 Integer key (255 bytes)
4 Real number key (255 bytes)
5 Long real number key (255 bytes)
6 Numeric display key (1 to 28 bytes)
7 Packed decimal key, odd number of digits (1 to 14 bytes)
8 Packed decimal key, even number of digits (2 to 14 bytes)
9 IEEE floating-point decimal key (4, 8, or 16 bytes)
key length Enter the length of the key in bytes. A maximum of 255
bytes is allowed, but the length is dependent on the type of
key data specified.
key location
Enter the relative location in bytes of the key field in the
record. Note that the first byte of the record is considered 1.
duplicate key flag Enter 1 if duplicate key values are allowed for this key.
Enter 0 if duplicate key values are not allowed for this key.
random insert flag This field specifies the method of inserting duplicate key
values. To use this feature, the previous duplicate key flag
must be set to 1.
Enter 0 if duplicate key values are to be inserted at the
end of the duplicate key chain.
Enter 1 if the duplicate key values are to be inserted
randomly in the duplicate key chain.
Figure 2-10. provides an example of the declarations that are needed to define and load a
KSAM XL parameter array using Pascal/iX. Chapter 4 , “Opening and Closing the File,
provides an example of an HPFOPEN intrinsic call that creates and opens a KSAM file.
Figure 2-10. KSAM Parameter Settings
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;
optm_blk: bit1;