TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
144 Chapter5
TurboIMAGE/XL Library Procedures
DBCLOSE
TPI option.
status
is the name of an array of 10 halfwords in which TurboIMAGE/XL returns
status information about the procedure. If the procedure executes
successfully, the status array contents are:
Element Contents
1 If the procedure succeeds, the return status is 0. Table 5-5.
describes the contents of element 1 when the procedure
does not succeed.
2-4 Unchanged from previous procedure call using this array.
5-10 Procedure call information. Refer to "Library Procedure
Error Messages" in appendix A for a description of this
information.
Discussion
You must call DBCLOSE mode 1 to terminate access to the database when you have
completed all the tasks you want to perform. If a process has issued multiple calls to
DBOPEN for the same database, only the access path specified in the DBCLOSE base
parameter is affected by the call to DBCLOSE.
The capability to reset and close a data set is provided to perform functions such as
reinitializing dynamic status information for a process accessing a particular data set and
returning system resources. In both modes 2 and 3, status information is reinitialized, but
system resources are returned in mode 2 only. The current list is not reset. Table 5-5.
summarizes the functions performed in each mode.
Because mode 3 does not close and reopen a data set, it is more efficient than mode 2 if the
data set is to be accessed again before the database is closed.
Only mode 3 is allowed within a dynamic transaction; mode 2 will return an error, and
mode 1 will abort the transaction.
If the process is logging, a mode 1 DBCLOSE causes a DBCLOSE log record to be written to the
log file. DBCLOSE log records contain such information as the time, date, and user log
identification number. A DBCLOSE log record is also written if the process aborts or
terminates without closing the database. If the process aborts before completing an active
transaction, a special DBEND log record is written prior to the DBCLOSE.
Table 5-5. DBCLOSE Modes 2 and 3 Functions
Function Mode 2 Mode 3
Reinitialize dynamic status information for the data set (chain
count, forward and backward pointers, current record number
and last return status).
YES YES
Close the data set. YES NO
Release locks held within the data set. NO NO
Current list reset. NO NO