Open Database File Exit Program


  Required Parameter Group:


  Exit Point Name: QIBM_QDB_OPEN

  Exit Point Format Name: DBOP0100

  QSYSINC Member Name: EDBOPNDB

The Open Database File exit program is called when a job is opening a database file. This exit is called in the job that is attempting to open the file. The exit program is passed a list of files referenced in the open request and the open options. The exit program may set a return code value to end the open request. When an open request is issued, the operating system calls the user-written exit program through the registration facility. For information about adding an exit program to an exit point, see the Registration Facility APIs.

If the file being opened is a logical file or a query, multiple files may be passed to the exit program. The originally requested files will be passed in as well as any underlying physical files. Only full opens will call the exit program. Hence,

The Open Database File Exit Program can only be used with database objects. An open of a DDM file will not call the exit program on the source system, but it will call the exit program on the target system.

Authorities and Locks

User Profile Authority
*ALLOBJ and *SECADM to add or remove exit programs to the registration facility

Required Parameter Group

Open Database File Input Information
INPUT;CHAR(*)

Information needed by the exit program for the database files involved in the open. For the format of this parameter, see DBOP0100 Format.


Open Database File Output Information
OUTPUT;BINARY(4)

Return code. The return code to indicate whether the open should be canceled. The valid values are:

0
The open should be rejected. Any remaining exit programs will not be called.
1
The open request should be accepted. The next exit program will be called or the open request will continue if there are no other exit programs. This is the default action.

DBOP0100 Format

The following tables show the format of the input information parameter for the exit program. For detailed descriptions of the fields in the table, see Field Descriptions.


The following structure shows the format of each array element of the Referenced File Array:



Field Descriptions

Current user name. The current user profile opening the database file.

Database file library name. The database file library name that is referenced in the open request.

Database file member name. The database file member name that is referenced in the open request. When processing partition tables the member will be returned as *ALL.

Database file name. A database file name that is referenced in the open request. This is always the 10-character system name.

Database file type. The type of the database file.

0
Physical database file.
1
Logical database file.

Database open delete option. The delete option specified for the file on the open request.

0
The file is not being opened for delete operations.
1
The file is being opened for delete operations.

Database open input option. The input option specified for the file on the open request.

0
The file is not being opened for input (read) operations.
1
The file is being opened for input (read) operations.

Database open output option. The output option specified for the file on the open request.

0
The file is not being opened for output (insert) operations.
1
The file is being opened for output (insert) operations.

Database open underlying physical file. The physical file underlying a logical file or view that was referenced in the open request.

0
The file was referenced in the open request directly or indirectly through an alias.
1
The file is an underlying physical file of a logical file or view that was referenced in the open request. This file was not directly referenced in the open request.

Database open update option. The update option specified for the file on the open request.

0
The file is not being opened for update operations.
1
The file is being opened for update operations.

Database query open. The interface used to run the database query against the files.

0
The file is not being opened for a database query.
1
The file is being queried by interactive SQL, STRSQL.
2
The file is being queried by other SQL interfaces.
3
The file is being queried by Query (QQQQRY) API.
4
The file is being queried by Open Query File command,OPNQRYF.
5
The file is being queried by other non-SQL query interfaces.
6
The file is being queried by the database host server.
7
The file is being queried by SQL Call Level Interface,CLI.
8
The file is being queried by Process Extended Dynamic SQL (QSQPRCED) API.

Format name. The name of the format being used.

Job name. The name of the job issuing the open request.

Job number. The number of the job issuing the open request.

Length of referenced file array element. The length of each element in the referenced file array.

Number of files in the referenced file array. The number of elements in the referenced file array.

Offset to the referenced file array. Indicates the offset from the start of the Open Database File Input Information to an array of files referenced in the open request.

Reserved. A reserved field.

Size of fixed header for DBOP0100. Size of header information.

User name. The user name under which the job that is issuing the open request is started.


Usage Notes

Note that auditing does not actually have to be active for this to apply.

The open exit will be called for all the files referenced in the open.
For example, physical file T1 has an object audit attribute of *NONE and physical file T2 has an object audit attribute of *CHANGE. *OBJAUD was specified in the exit program data. An open of T1 will not call the exit. An open of T2 will call the exit. A join query that includes both T1 and T2, will call the open exit for both T1 and T2, not just T2.


Exit program introduced: V5R3

[ Back to top | Database and File APIs | APIs by category ]