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

Appendix B 243
BASIC/V Intrinsics
BKOPEN
records to a file, but not to change or delete existing records. If you plan to read and write
records during the same process but do not want to alter existing records, use this access
mode.
If you want to rewrite or delete existing records in a KSAM file, you must open with
access
= 4. This mode allows you to use the BKREWRITE and BKDELETE procedures, as well
as all the other procedures described in this section.
Table B-2. summarizes the procedures you may call depending on the
access
parameter
value you specify in BKOPEN.
By default in a multi-user environment, all users whose MPE security restrictions allow
them to access your file can read the file, but they cannot change the file or add new
records to it. This is the default specification of the
exclusive
parameter in BKOPEN
(
exclusive
=2). It is independent of the value of the
access
parameter.
If you want to prevent other users from reading the file as well as writing to it, you must
specify this by setting
exclusive
=1. This setting allows only you to read from, write to, or
alter the file.
Another alternative is to set
exclusive
=0, thereby allowing other users access to the file
only when it is opened for read only (
access
=0). This setting of the
exclusive
parameter
prevents any access by other users when the file is opened for any form of write or update
(
accesss
0). This means that you and other users share read access to the file, but only
you can write to or change the file.
You can choose to completely share access to the file, reading and/or writing and updating,
by setting the
exclusive
parameter to 3.
(Refer to Table B-2. for a summary of the relation between the
exclusive
parameter and
Table B-2. Procedures Allowed by BKOPEN Access Parameter
Procedure Read-only
(
access
=0)
Write-only
with Clear
(
access
=1)
Write-only
with Save
(
access
=2)
Read/Write
(
access
=3)
Update
(
access
=4)
BKREAD XXX
BKREADBYKEY XXX
BKSTART XXX
BKWRITE XXXX
BKREWRITE X
BKDELETE X
BKCLOSE XXXXX
BKERROR XXXXX