HP 3000 Manuals

The New Native Mode KSAM File: KSAM XL [ COMMUNICATOR 3000/XL XL RELEASE 2.1 ] MPE/iX Communicators


COMMUNICATOR 3000/XL XL RELEASE 2.1

The New Native Mode KSAM File:  KSAM XL 

by Joanne Gong/Stanley Wang 
Commercial Systems Division 

Native Mode (NM) Keyed Sequential Access Method (KSAM), is now supported
on this XL release.  A file created by the new NM KSAM is referred to as
a "KSAM XL file" and a file created by Compatibility Mode (CM) KSAM on
MPE XL, or by KSAM/3000 on MPE V/E, is referred to as a "CM KSAM file." A
KSAM XL file can be accessed by applications in NM or in CM. All the file
system intrinsics used to access CM KSAM files can also access KSAM XL
files.  The user interface of KSAM XL files is now through MPE XL
commands.  KSAMUTIL will continue to be supported for CM KSAM files only.

PRODUCT FEATURES 

The new features of the KSAM XL implementation include single file,
immediate data access, file level locking, data space reuse option, user
interface, automatic recovery and data logging, and a different file type
for KSAM XL files.

Single File 

A KSAM XL file consists of a single file with the key and data areas in
the same file space.  The change from the two-file structure of CM KSAM
to the single file structure of KSAM XL provides convenience and easy
maintenance for KSAM XL files.

File Level Locking 

File level locking through FLOCK intrinsic is the standard form of
locking used by CM KSAM. The KSAM XL type manager provides implicit file
level locking for each read, write or update intrinsic call.  A share 
lock is provided for a read intrinsic and an exclusive lock is provided
for a write or update intrinsic.  The KSAM XL automatic lock locks the
file in a consistent state for the duration of an intrinsic.  To lock the
file in a consistent state for the duration of multiple intrinsics
requires a call to FLOCK and FUNLOCK around the multiple intrinsics.

Immediate Data Access 

The MPE XL file system guarantees the order of concurrent data accesses.
Any alterations (additions, deletions or modifications) to the KSAM XL
file will be reflected immediately upon subsequent accesses by any
process.

Data Space Reuse Option 

At the file creation time, a reuse or noreuse option may be specified in
:BUILD command or, if the creation is through FOPEN or HPFOPEN, bit 12 of
the flagword of the ksamparam can be set to 1 for reuse option or 0 for
noreuse option.  If reuse option is selected, the space of a deleted
record in the KSAM XL file can be reused for the data addition.  When
adding records to a KSAM XL file, the deleted records space will first be
used.  If there are no deleted data slots available, records will be
appended to the end of the file.  The reuse option allows the utilization
of the space occupied by the deleted records but the chronological order
of the data records is not preserved.  Users who do rely on the
chronological order of KSAM XL records should not specify the reuse 
option.  The default for this option is noreuse.

MPE XL Commands, KSAMUTIL, and Copy Mode 

The KSAMUTIL does not support KSAM XL files, it only supports CM KSAM
files.  Several MPE XL commands have been modified to provide the
KSAMUTIL functions.  Users can use :BUILD to build a KSAM XL file,
:LISTFILE to find KSAM XL specific information, :RENAME to change the
file name, :SAVE to save it in the permanent file domain, or :PURGE to
delete it.  File equations can also be used for KSAM XL files.  For more
information, refer to MPE XL Commands Reference Manual (P/N 32650-60002).

Copy Mode is invoked when a CM KSAM file is opened with bit 3 of the
aoptions parameter of FOPEN set to 1.  In that case, the CM KSAM file is
treated as a standard MPE flat file.  The KSAM XL file does not support
copy mode and will have to be copied using a record by record format.

Automatic Recovery and Data Logging 

The KSAM XL type manager utilizes Transaction Management to perform
special system logging to ensure minimal data loss, data consistency and
recoverability from system software crashes and hardware failures.  If a
failure occurs, all the committed transactions will be recovered and all
the incomplete transactions will be backed out automatically when the
system is restarted.

CM KSAM and KSAM XL File Type Differences 

The CM KSAM file and the KSAM XL file are distinguished by the file type
in the foptions parameter of FOPEN and HPFOPEN. The file type of CM KSAM
is 1 and the file type of KSAM XL is 3.  :LISTF, 2 displays the KSAM XL
file type with a letter "K." In CM KSAM, you can specify the filecode in
FOPEN or HPFOPEN for the data file but the key file is automatically
assigned a filecode of 1080.  For KSAM XL files, you can specify the
filecode through FOPEN or HPFOPEN.

FCOPY AND MIGRATION STRATEGY 

All the existing applications that access CM KSAM files can access KSAM
XL files without changes to the programs except for the case that FOPEN
or HPFOPEN intrinsic is called to create a new KSAM file, where the file
type in the foptions parameter may need to be changed.  In the case that
FOPEN or HPFOPEN is called to open an existing KSAM file, the MPE XL file
system will determine automatically for you whether the file being opened
is a KSAM XL or a CM KSAM file.  The FCOPY subsystem will be used to
ensure a smooth transition of existing CM KSAM files to KSAM XL format.
FCOPY has been enhanced to copy between two KSAM XL files, from a CM KSAM
file to a KSAM XL file or vice versa.  Since KSAM XL files cannot be
opened in Copy Mode, noksam option of FCOPY is not supported for copying
a KSAM XL file.  FCOPY from a CM KSAM file to a KSAM XL file will be
frequently used for migration.  If you open the CM KSAM file with noksam 
option, the corresponding KSAM XL file will have the deleted data records
of the CM KSAM file as active data records in the KSAM XL file.  If the
KEY=0 option is selected when opening the CM KSAM file, the corresponding
KSAM XL file will only have the active data records of the CM KSAM file.

Migration of existing CM KSAM files to KSAM XL files involves a sequence
of steps described below.  The first two steps are necessary if migrating
from an MPE V/E machine to an MPE XL machine.

 *  Store both the KEY and DATA files onto tape (necessary only if
    migrating from an MPE V/E machine).

 *  Restore both the key and data files to an MPE XL machine.

 *  Run FCOPY to do the conversion from CM KSAM files to KSAM XL files.



MPE/iX Communicators