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

Appendix A 195
COBOL Intrinsics
CKOPEN
pointer to the first record in the primary key chain.
Figure A-3. Procedures Allowed for Input/Output Type/Access Mode
Combinations
Halfword 6 of
filetable
must be set to one of the following values before calling CKOPEN:
0 input only
1 output only
2 input/output
In general, if you want to allow records to be read or the file to be positioned without
allowing any new records to be written or any existing records to be changed, you should
set the input/output type to 0. This input/output type allows you to call CKREAD or CKSTART
in sequential processing mode, CKREADBYKEY in random mode, or all three in dynamic
mode.
If you want to cause all existing records to be deleted when the file is opened and then
allow new records to be written, you should set the input/output type to 1. This type of
open deletes all existing records so that records are written to an empty file. When a file is
opened for output only, you can call CKWRITE in any of the three access modes: sequential,
random, or dynamic, but you cannot call any other of the KSAM procedures.
If you want unrestricted file access, you should set the input/output type to 2. This access
type allows records to be read, positioned, written, rewritten, or deleted. You may call
CKREAD, CKSTART, CKREWRITE, and CKDELETE (but not CKWRITE) when opened in sequential