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

210 AppendixA
COBOL Intrinsics
CKSTART
CKSTART
A call to procedure CKSTART allows you to position the record pointer to a particular record
in a KSAM file defined by its primary or alternate key value.
CALL "CKSTART" USING
filetable, status, relop, key, keyloc, keylength
In order to position the current record pointer to a location in the file defined by a key
value, call CKSTART. Since CKSTART is used in preparation for sequential retrieval of
records with CKREAD, the file must be open for sequential or dynamic access, not random,
and for input or input/output, not output only.
Parameters
filetable
An 8 halfword record containing the number and name of the file, its
input/output type, access mode, and a code indicating whether the
previous operation was successful and if so, what it was.
status
One halfword (two 8-bit characters) set to a pair of values upon completion
of the call to CKSTART to indicate whether or not the call was successful
and if not why not. (Refer to Status Parameter discussion earlier in this
section.)
relop
One halfword integer (S9(4)COMP) code that specifies a relation between
the key value specified in the call to CKSTART and the key value in the
record to which the record pointer is to be positioned:
0 — record key is equal to
key
1 — record key is greater than
key
2 — record key is greater than or equal to
key
key
An item whose value is used by CKSTART to locate the record at which to
position the record pointer. The values of a specified file key are compared
in ascending order to the value of
key
according to the relation specified by
relop
.
keyloc
One halfword integer (S9(4)COMP) set to the starting character location of
a key in the KSAM file data record (first position is character 1). The key
at
keyloc
is compared to
key
.
keylength
One halfword integer (S9(4)COMP) set to the length of
key
; the length
must be less than or equal to the length of the key defined by
keyloc
.
Operation Notes
When CKSTART is executed, the index area is searched for the first key in the set of keys at
location
keyloc
whose value when compared with
key
satisfies the comparison specified
by
relop
. The current record pointer is positioned to the beginning of the record in the
data area associated with the key found by CKSTART.
The specified length of
key
(
key length
) may be less than the length of the key in the file;