1 | Query Governor Input Information | Input | Char(*) |
2 | Return Code | Output | Binary(4) |
The Query Governor exit program is called when a job is running a query and the estimated runtime or temporary storage usage has exceeded the user specified limits. This exit is called in the job that is attempting to run the query. The exit program is passed a structure that contains the estimated runtime, the user specified runtime limit, the estimated temporary storage usage, and the user specified temporary storage limit for the query. Also included is the Structured Query Language (SQL) statement text of the query, if applicable. The exit program may set a return code value that is basically used to either ignore the exceeded limit and continue running the query or end the query request. When a query is run, 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.
Only query full opens will call the exit program, thus if the query is the result of an SQL statement, pseudo opens will not call the exit program. Also, a query of a DDM file will not call the exit program on the source system, but it could call the exit program on the target system. A native open of an SQL view could call the exit program.
The Query Governor can be enabled by using the Query processing time limit (QRYTIMLMT) or Query temporary storage limit (QRYSTGLMT) parameters on the Change Query Attributes (CHGQRYA) CL command. It can also be enabled by setting the QUERY_TIME_LIMIT or STORAGE_LIMIT options in the query options file. The query time limit can also be enabled by using the QQRYTIMLMT system value.
Authorities and Locks
Information needed by the exit program with respect to the query that exceeded user specified runtime or temporary storage usage limits. For the format of this parameter, see QRYG0100 Format.
Return code. The return code to indicate whether the query should be canceled. The valid values are:
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 QRYG0100 |
4 | 4 | CHAR(8) | Format name |
12 | C | CHAR(10) | Job name |
22 | 16 | CHAR(10) | User name |
32 | 20 | CHAR(6) | Job number |
38 | 26 | CHAR(10) | Current user name |
48 | 30 | BINARY(4) | Estimated runtime in seconds |
52 | 34 | BINARY(4) | Specified time limit in seconds |
56 | 38 | BINARY(4) | Estimated temporary storage usage in megabytes |
60 | 3C | BINARY(4) | Specified temporary storage limit in megabytes |
64 | 40 | BINARY(4) | Offset to SQL statement text |
68 | 44 | BINARY(4) | Length of SQL statement text |
72 | 48 | CHAR(*) | Reserved |
Current user name. The current user profile initiating the query.
Estimated runtime in seconds. The query's estimated runtime in number of seconds.
Estimated temporary storage usage in megabytes. The query's estimated query temporary storage usage number in megabytes.
Format name. The name of the format being used.
Job name. The name of the job issuing the query request.
Job number. The number of the job issuing the query request.
Length of SQL statement text. The length of the SQL statement that exceeded the user specified query limit. 0 if the query is not SQL.
Offset to SQL statement text. Offset from the start of the Query Governor Input Information to the SQL statment that exceeded the user specified query limit. 0 if the query is not SQL.
Size of fixed header for QRYG0100. Size of fixed header information.
Specified temporary storage limit in megabytes. The user specified query temporary storage usage limit in number of megabytes.
Specified time limit in seconds. The user specified query time limit in number of seconds.
User Name. The user name under which the job that is issuing the query request is started.
Top | Database and File APIs | APIs by category |