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

19
2 Creating a KSAM File
You can create a KSAM file in several different ways:
Using the BUILD command. The file name and file characteristics are specified in the
command parameters. The file can then be loaded with data by using the FCOPY
subsystem to load existing file data or by directing program output to the file.
Copying an existing file using the FCOPY subsystem. File characteristics can be
defaulted to those of the existing file or modified by using a file equation.
Using HPFOPEN or FOPEN intrinsic parameters from within an application program. The
intrinsic call creates and opens the file. The program's output can then be written to the
opened file.
Creating the File With the BUILD Command
The BUILD command parameters define standard file characteristics, such as the file and
record lengths, and file, record, and data types. For KSAM files, you must also specify
characteristics of each key field and special KSAM options. The following list offers the
most common file characteristics that you need to decide before building a KSAM file.
The file name.
Size of the record.
Record type of F for fixed-length records (required for KSAM files).
Binary-coded or ASCII-coded data.
Permanent or temporary file.
Device class DISC (required for KSAM files).
The maximum number of records.
The language ID.
A file type of KSAMXL (required for KSAM XL files).
A file type of KSAM64 (required for KSAM64 files)
Information about each key (repeated up to sixteen times); at least one key is required:
Type of key data.
The location of the first byte of the key.