HPlogo Using KSAM XL and KSAM 64

Using KSAM XL and KSAM 64: 900 Series HP 3000 Computer Systems

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 4 ♥
E0394 Edition 3

HP Part Number: 32650-90886

Edition:

Published: E0300

Notice

Table of Contents
Preface
In This Book
1 Introduction
Terminology
KSAM XL File Format
Index Area
Data Area
Automatic Recovery
2 Creating a KSAM File
Creating the File With the BUILD Command
KSAM File Characteristics
Sample BUILD Command
Specifying an Indirect File
Loading Data to a KSAM XL File
Loading Data to a KSAM64 File
Modifying Existing File Specifications While Copying
Building a KSAM File Programmatically
Language ID
Flag word
Number of Keys
Key Parameters
Using Related Commands
Deleting a KSAM File
Renaming a KSAM File
Modifying File Attributes
3 Obtaining File Information
Displaying File and Key Information
Accessing File Information from a Program
Accessing Key Information From a Program
Accessing User-Defined Labels
4 Opening and Closing the File
Opening an Existing KSAM File
Using the HPFOPEN Intrinsic

Using the FOPEN Intrinsic
Opening a New File
Closing a KSAM File
5 Reading File Data
Sequential Access by Primary Key
Sequential Access by Primary and Alternate Key
Specifying the Record Number
Specifying a Key Value
Sequential Access by Partial Key Value
Random Access of a Single Record
Using a Key Value
Using the Relative Record Number
Using a Physical Record Number
Sequential Access in Physical Record Order
Shared File Access
6 Writing and Updating Record Data
Writing New Records
Updating Existing Records
Deleting a Record
Shared Access
7 Protecting the File and Its Data
Checking Error Information
Protecting Data When File Access is Shared
Writing Directly to Disk
Recovering from a System or Software Abort
Backing Up KSAM Files
Recovering from Index Corruption
8 Migration and Mixed Mode Processing
Similarities in KSAM File Features
Differences in KSAM File Features
Migrating KSAM Files
Mixed Mode Operation
9 KSAM Intrinsics
FCHECK
FCLOSE
FCONTROL
FERRMSG
FFILEINFO
FFINDBYKEY
FFINDN
FGETINFO
FGETKEYINFO
FLABELINFO
FLOCK
FOPEN
FPOINT
FREAD
FREADBYKEY
FREADC
FREADDIR
FREADLABEL
FREMOVE
FRENAME
FSPACE
FUNLOCK
FUPDATE
FWRITE
FWRITELABEL
HPFOPEN
A COBOL Intrinsics
Calling a KSAM Procedure
Filetable Parameter
Status Parameter
KSAM Logical Record Pointer
Shared Access
Sample KSAM File
CKCLOSE
CKDELETE
CKERROR
CKLOCK
CKOPEN
CKOPENSHR
CKREAD
CKREADBYKEY
CKREWRITE
CKSTART
CKUNLOCK
CKWRITE
Examples of KSAM File Access
Sequential Write
Sequential Read
Random Update
B BASIC/V Intrinsics
Overview
Calling a KSAM Procedure
Optional Parameters
Status Parameter
KSAM Logical Record Pointer
Shared Access
BKCLOSE
BKDELETE
BKERROR
BKLOCK
BKOPEN
BKREAD
BKREADBYKEY
BKREWRITE
BKSTART
BKUNLOCK
BKWRITE
C HP C/iX Example Program
Index
List of Figures
1-1 General Representation of the KSAM Format
1-2 A Simplified View of the KSAM File Structure
1-3 Simple Index Tree Structure
2-1 Creating a KSAM XL file using the OPTMBLK parameter
2-2 Creating a KSAM 64 file using the OPTMBLK parameter
2-3 Creating a KSAM XL file with data block size set at 4K bytes (default)
2-4 Creating a KSAM 64 file with data block size set at 4K bytes (default)
2-5 Building the AR Master KSAM XL File
2-6 Building the AR Master KSAM64 File
2-7 Using a Key Data File to Create a KSAM XL File
2-8 Using a Key Data File to Create a KSAM 64 File
2-9 KSAM Parameter Format
2-10 KSAM Parameter Settings
3-1 File Type Display
3-2 File Information Display for a KSAM XL File
3-3 File Information Display for a KSAM64 File
3-4 Key Information Display for a KSAM XL File
3-5 Key Information Display for KSAM64 File
4-1 Opening an Existing KSAM File with HPFOPEN
4-2 Opening a New KSAM File with HPFOPEN
4-3 Opening a New KSAM XL File with FOPEN
5-1 FFINDN Intrinsic Sample
5-2 FFINDBYKEY Intrinsic Sample
5-3 Partial Key Search Sample
5-4 Accessing a Record by Key Value
7-1 Index Corruption Recovery for a KSAMXL File
7-2 Index Corruption Recovery for a KSAM64 File
9-1 Foption Bit Summary
9-2 Aoption Bit Summary
9-3 FGETKEYINFO Parameter Format
9-4 FGETKEYINFO Control Parameter Format
9-5 Foption Bit Summary
9-6 FOPEN KSAM Parameter Format
9-7 HPFOPEN KSAM Parameter Format
A-1 Filetable Structure
A-2 Representation of KSAMFILE Used in COBOL Examples
A-3 Procedures Allowed for Input/Output Type/Access Mode Combinations
A-4 Sequential Write Using COBOL
A-5 Sequential Read Using COBOL
A-6 Random Update with COBOL
B-1 Closing a KSAM File with BKCLOSE
B-2 Deleting a Record With BKDELETE
B-3 Dynamically Locking a KSAM File with BKLOCK
B-4 Opening KSAM File with BKOPEN
B-5 Reading From a KSAM File with BKREAD
B-6 Reading a Record Located by Key Value with BKREADBYKEY
B-7 BKREAD values
B-8 After BKREWRITE
B-9 Rewriting Record in KSAM File with BKREWRITE
B-10 Positioning Pointer to Least-Valued Record with BKSTART
B-11 Positioning Pointer to Particular Record with BKSTART
B-12 Dynamically Unlocking a KSAM File
B-13 Writing to a KSAM File with BKWRITE
List of Tables
5-1 Pointer and Advance Flag Settings for Reading
6-1 Pointer and Advance Flag Settings for Writing
9-1 FCONTROL Itemnum/Item Values
9-2 FFILEINFO Itemnum/Item Values
9-3 FFILEINFO File Codes
9-4 FGETKEYINFO Control Parameter Format
9-5 FLABELINFO Itemnum/Item Values
9-6 FOPEN/HPFOPEN Parameter Equivalents
9-7 HPFOPEN Itemnum/Item Values
9-8 FOPEN/HPFOPEN Parameter Equivalents
A-1 Positioning the Logical Record Pointer
B-1 Positioning the Logical Record Pointer
B-2 Procedures Allowed by BKOPEN Access Parameter
B-3 Relationship of Exclusive Parameter to Access Parameter




Index


Preface