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

242 AppendixB
BASIC/V Intrinsics
BKOPEN
concurrently by any user in any access mode, subject only
to the MPE security provisions in effect.
(
Optional parameter
) Default: If omitted or out of range, exclusive
equals 2, semi-exclusive access.
sequence
A numeric expression whose value indicates whether records written to
the file will be checked for primary key sequence or not. Acceptable values
are:
0 No sequence checking. When records are written to the
file, primary key values can be in any order; their
sequence is not checked. (
Default value
.)
1 Sequence checking. As each record is written to the file,
KSAM checks to ensure that its primary key value is
greater than the primary key value of any previously
written records. If duplicates are allowed for this key, then
the primary key can be equal to that of the previously
written record.
(
Optional parameter
) Default: If omitted or out of range, sequence = 0,
no sequence checking.
Operation Notes
After calling BKOPEN, you should always check the
status
parameter to determine
whether the open was successful. Upon successful execution of BKOPEN, the file named in
name
is available for processing. An identification number is assigned to this file and
returned to
filenum
where it is available to identify the open file in other calls. Until the
file is successfully opened with BKOPEN, no operation can be executed that references the
file either explicitly or implicitly.
If only the first three parameters are specified and the file is opened successfully, the file
has the following default characteristics:
Read and write access: you can read from and write to but not update the file.
Semi-exclusive access: other users can read from but not write to or update the file.
Dynamic locking not allowed: you cannot lock or unlock a file.
No sequence checking: records can be written in any order without checking sequence of
primary key values.
There are two types of write only access. One clears any existing records before writing the
specified records to the file (
access
= 1). The other saves existing records and writes the
new records after those already written (
access
= 2). Both these access modes do not
permit any read or update access to the file.
Read-only access (
access
= 0) can be specified if you want to ensure that the file is not
changed. This mode prohibits the writing of new records, and rewriting or deleting of
existing records. In read-only mode, you can position the file and read records in either
sequential or random order.
The default access mode (
access
= 3) allows you both to read records from and write