TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

Chapter 5 143
TurboIMAGE/XL Library Procedures
DBCLOSE
DBCLOSE
INTRINSIC NUMBER 403
Terminates access to a database or a data set, or rewinds a data set. DBCLOSE is used in
conjunction with DBOPEN to establish and terminate access to a database.
Syntax
DBCLOSE,
base,dset,mode,status
Parameters
base
is the name of an array used as the base parameter when opening the
database. The first element of the array must contain the base ID returned
by DBOPEN. (Refer to DBOPEN for more information about the base ID.)
dset
is the name of an array containing the left-justified name of the data set to
be closed, or is an integer referencing the data set by number if mode
equals 2 or 3. If mode equals 1, this parameter is ignored. The data set
name can be up to 16 characters long. If shorter, it must be terminated by
a semicolon or a blank.
mode
is an integer equal to 1, 2, or 3 indicating the type of termination desired
as follows:
Mode 1: Access to the database is terminated. Any locks held by
this user for this base ID are released. If DBCLOSE mode 1
is called while a dynamic transaction is still active, an
error is returned, the transaction is aborted, and the
database is closed automatically. You do not need to call
DBXEND or DBXUNDO.
Mode 2: The data set referenced by the dset array is closed, but
locks held in the data set are not released. If DBCLOSE
mode 2 is called while a dynamic transaction is still active,
an error is returned. You must check the error and decide
to use DBXEND, DBXUNDO, or continue with the
transaction even if DBCLOSE mode 2 failed. DBXUNDO will
abort the entire dynamic transaction. DBXEND will
terminate the dynamic transaction; the modifications
completed thus far within the transaction will remain in
the database.
Mode 3: If mode equals 3, the data set referenced by the dset array
is reinitialized but not closed.
If your database is enabled for third-party indexing (TPI), refer to your
vendor documentation for additional DBCLOSE mode information. The
section on DBUTIL in chapter 8 of this book has a brief description of the