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

Chapter 2 21
Creating a KSAM File
Creating the File With the BUILD Command
real 1 to 255 bytes of real number data.
IEEE real 4, 8, or 16 bytes of IEEE real number data.
numeric 1 to 28 bytes of numeric data.
packed 1 to 14 bytes of packed decimal data (odd number of characters).
*packed 2 to 14 bytes of signed packed decimal data (even number of characters).
The duplication key characteristic is an optional field. If a key must be unique, such as an
account number or social security number, no additional parameters are made. The default
value is no duplication. If the key can be duplicated, there are two methods of inserting
duplicate key values in the index's duplicate key chain.
DUP specifies that each new duplicate key is inserted at the end of the duplicate key chain,
maintaining chronological order.
RDUP specifies that each new duplicate key is inserted randomly in the duplicate key chain.
RDUP is used if the reuse option is selected. With RDUP, chronological order is not
maintained.
First Record Number
The ;FIRSTREC= parameter of the BUILD command specifies the number of the first record
in the file. Several record retrieval methods use record numbers to identify the physical
location of a record. You can specify whether to use "0" or "1" to identify the first record.
The default value is 0.
REUSE Option
KSAM files can reuse deleted record space if the REUSE option is specified. This option,
however, increases the allocated space reserved for the file by 15 percent and distributes
free space evenly throughout the file when the file is initially loaded. When a record is to
be added to the file, free space is available so that a search for record space is not lengthy.
When a record is deleted, its space is added to the free space available.
The NOREUSE option, the default value, does not allow the reuse of deleted record space.
This option maintains physical record order. A new record is appended to the end of the
file, even if other records have been deleted. If many records are added and deleted, the file
continues to expand in size. In such cases, it is recommended that the file be copied
regularly to eliminate the unusable space if disk space is needed.
Language ID
The optional ;LANG= parameter of the BUILD command 224 specifies the native language
specifies the native language of the data in the file. You can select the language by entering
a code of up to three digits or by entering the language name. To find out what languages
can be accessed on your system, enter RUN NLUTIL.PUB.SYS. Any of the listed language
IDs can be entered in this field. The default language is Native-3000. Different affectd
languages may cause the sequential ordering of records to be affected.
OPTMBLK/DEFBLK Option
Users can assure efficient disk space utilization by using the OPTMBLK option of the BUILD
command. When specified, OPTMBLK allows KSAM to choose the optimal data block size