MPE/iX Commands Reference Manual (32650-90864)

116 Chapter 2
Command Definitions A-B
BUILD
;KEY=
(keytype,keylocation,keysize
[,DUP|RDUP];
.
.
keytype,keylocation,keysize
[,DUP|RDUP])
One key specification (keytype, keylocation, keysize [,DUP|RDUP] must be
included for each key in the KSAM file. The first occurrence of the key
specification describes the primary key; each subsequent key specification
describes an alternate key. There may be up to 15 alternate key
specifications in addition to the primary key description.
keytype KSAM key type, specified as BYTE, INTEGER, REAL, IEEEREAL,
NUMERIC, PACKED, OR *PACKED. Specify the whole word or only the
first letter; valid abbreviations are B, I, R, E, N, P, and *. If more than one
letter is specified, the word must be spelled correctly.
keylocation Location of the first byte of the key within the data record counting from
the first byte in the record. The first byte in the data record is always
numbered 1. Only one key can start at the same location. This parameter
applies only to KSAM files.
keysize Length of the KSAM key in bytes. The length depends on keytype as follows:
BYTE 1 to 255 bytes
INTEGER 1 to 255 bytes
REAL 1 to 255 bytes
IEEEREAL 4, 8, or 16 bytes
NUMERIC 1 to 28 bytes
PACKED 1 to 14 bytes (odd number of digits)
*PACKED 2 to 14 bytes (even number of digits)
This parameter is required for all key types.
DUP OR RDUP These two options apply only to KSAM files. The DUP option allows you to
specify that duplicate key values are permitted. If DUP is not specified,
records with duplicate key values are rejected and an error message is
issued when such records are written to the file. When the DUP option is
used, each new duplicate key is inserted at the end of the duplicate key
chain. This maintains the chronological order of the duplicate keys.
The RDUP option specifies that duplicate keys are allowed and to be
inserted randomly in the duplicate key chain. This method makes
insertion of such keys faster, but does not maintain the chronological order
of the duplicate key chain. The default is that duplicate keys are not
allowed.
recnum Determines whether record numbers in the new KSAM file are to start
with zero or one. If the integer 1 is specified, records are numbered
beginning with 1; otherwise, they start with 0. The only acceptable values
for recnum are 1 and 0. This option can only be used for new KSAM files.
REUSE or NOREUSE The REUSE option forces KSAM files to reuse deleted record space.
The REUSE option forces RDUP to be set to TRUE for all keys.