Open Database File Exit Program


  Required Parameter Group:

1 Open Database File Input Information Input Char(*)
2 Return Code Output Binary(4)

  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.

Offset Type Field
Dec Hex
0 0 BINARY(4) Size of fixed header for DBOP0100
4 4 CHAR(8) Format name
12 C BINARY(4) Offset to the referenced file array
16 10 BINARY(4) Number of files in the referenced file array
20 14 BINARY(4) Length of the referenced file array element
24 18 CHAR(10) Job name
34 22 CHAR(10) User name
44 2C Start of changeCHAR(6) End of change Job number
Start of change50 32 End of change CHAR(10) Current user name
Start of change60 3C CHAR(1) Database query open
61 3D End of change CHAR(*) Reserved

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

Offset Type Field
Dec Hex
0 0 CHAR(10) Database file name
10 A CHAR(10) Database file library name
20 14 CHAR(10) Database file member name
30 1E CHAR(2) Reserved
32 20 BINARY(4) Database file type
36 24 BINARY(4) Database open underlying physical file
40 28 CHAR(1) Database open input option
41 29 CHAR(1) Database open output option
42 2A CHAR(1) Database open update option
43 2B CHAR(1) Database open delete option
44 2C CHAR(*) Reserved


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.

Start of changeDatabase 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. End of change

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


Exit program introduced: V5R3
Top | Database and File APIs | APIs by category