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

177
A COBOL Intrinsics
COBOL compilers (COBOL 68 and earlier) required special intrinsics to access keyed files.
The following intrinsics are provided only for the maintenance of COBOL 68 or earlier
COBOL programs using KSAM structures.
NOTE
Do not use these intrinsics for new programming. Current COBOL file access
modules provide KSAM file access.
Calling a KSAM Procedure
KSAM files are accessed from COBOL programs through calls to a set of procedures. These
procedures allow you to open, open for shared access, write records to, read records from,
lock, unlock, update, position, and close a KSAM file. The COBOL procedures provided
with KSAM/3000 correspond to the INDEXED I/O module statements in COBOL 74.
In HP COBOL/3000, the procedures that are used to access KSAM files differ in form from
the COBOL input/output statements used to access non-KSAM files. The KSAM interface
procedures use parameters for information that would otherwise be specified in the
FILE-CONTROL paragraph and the FD entry of the DATA DIVISION. These parameters
are themselves defined in the WORKING-STORAGE section of the DATA DIVISION. The
main restriction on the KSAM interface call parameters is that they must be 16 bit
aligned.
The KSAM interface procedures are called using a CALL statement of the following general
form.
CALL "name" USING filetable,status [,parameter[,. . .] ]
Where:
”name”
identifies the procedure to which control is transferred.
filetable
an 8-halfword table that identifies the file by name and in which access
mode and input/output type are specified, and to which is returned the file
number on open, and a code identifying the previous operation.
status
One halfword to which a two-character code is returned that indicates the
status of the input/output operation performed on the file by the called
procedure.
parameter
One or more parameters, depending on the particular procedure called,