Why does a batch job return:
DB13001E UNEXPECTED RETURN CODE 46 (46) BASE OPEN IN ANOTHER COPY OF DATACOM
or
DB13001E - UNEXPECTED RETURN CODE 46 (1) CLOSE/STATS ERROR
message?
Datacom/DB
Datacom/AD
The return code 46 means:
001 You attempted to use the DBUTLTY COMM CLOSE function to close one or more bases that had a User Requirements Table(s) open.
046 You attempted to open a table for update in more than one partition. Or, a transaction requiring the maintenance of the Directory (CXX) (such as CREATE TABLE or CATALOG) is being done in an update-eligible Multi-User Facility for a database while a read-only Multi-User Facility has the same database open and the CXX is shared between the two Multi-User Facilities.
If a Datacom job fails with RC 46(46) or 46(1), you can ascertain the jobs, including any CICS regions using Datacom, which already have that database OPEN for UPDATE.
Run a DBUTLTY batch job with the following SYSIN:
ACCESS STATUS=OFF,DBID=nnnn,USERS=FAIL
If the Datacom MUF has it OPEN for job(s) or by virtue of ACCESS OPTIMIZE, it will issue the following message showing which job(s) have it open for UPDATE.
DB00607I BASE nnnn ACCESS status (information) (job names) (x) (j)
where (j) lists the job(s)that have opened the database for "UPDATE" inside MUF.
Please note that the above card set the ACCESS status to OFF anyway, even if the DBUTLTY failed. See article How does ACCESS OFF work with USERS=WAIT and USERS=FAIL? for details
DATACOM MESSAGES documentation section Datacom/DB Return Codes Quick Reference for the list and explanation of return codes, such as Return Code 46 and for details on DB00607I
Article 142943 CA Datacom DB00501E RC 46(46) Database Open error
There are also two Datacom Dynamic System Tables (DST) available to DBSQLPR SQL SELECT or SYSVIEW for the database access and status:
DIR_DATABASE
MUF_OPEN_BASES
Refer to DATACOM CORE 15.1 documentation section Dynamic System Tables