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

204 AppendixA
COBOL Intrinsics
CKREADBYKEY
To find a record by the value of an alternate key, simply change two statements in the
preceding example so that
KEYLOC
contains the location of the alternate key and the
key
value for comparison is found in item
PHONE OF DAT
rather than in
NAME OF DAT
:
FIND RECORD.
READ NEW-DATA INTO DAT;
AT END GO TO FINISH.
MOVE 23 TO KEYLOC.
CALL "CKREADBYKEY" USING FILETABLE, STAT, REC, PHONE OF DAT,
KEYLOC, RECSIZE.