The governor exit routine supplied by IBM controls how many rows a user can retrieve from the database. The governor exit routine is shipped with two predefined values for the number of rows:
DSQUn00 QMF governor prompt: Command has fetched 25,000 rows of data. ==> To continue QMF command press the "ENTER" key. ==> To cancel QMF command type "CANCEL" then press the "ENTER" key ==> To turn off prompting type "NOPROMPT" then press the "ENTER" key
Row limit exceeded! Your command canceled by QMF governor.
When running a procedure, you might get a message that your procedure was canceled, rather than the message in Figure 213. For example, if your procedure contains a command that requires the report to complete (such as ERASE), you receive the message shown in Figure 214.
Procedure canceled.
Users using the SYSTEM profile, are already set up to use these default values of 25, 000 and 100, 000.
If you want to define your own limits for when the user is warned and when data retrieval is canceled, see Defining your own resource limits.
Follow this procedure to set up the governor exit routine to warn a user when the number of rows retrieved from the database reaches 25, 000 and to cancel the QMF activity when the number of rows retrieved reaches 100 ,000:
UPDATE Q.RESOURCE_VIEW SET INTVAL=0 WHERE RESOURCE_OPTION='SCOPE' AND RESOURCE_GROUP='SYSTEM'
Important: Always specify a value for the TRANSLATION column, or you might change more rows in Q.PROFILES than you intend.
If you want to define row limits other than the defaults of 25, 000 and 100, 000, read How a governor exit routine controls resources. Then see the procedure in Defining your own resource limits.
The governor uses two types of information to control resources.
Each row of the IBM-supplied Q.RESOURCE_TABLE contains:
Table 78 shows the structure of the Q.RESOURCE_TABLE as it is shipped by IBM. Q.RESOURCE_TABLE has the index Q.RESOURCE_INDEX. Keyed columns are RESOURCE_GROUP and RESOURCE_OPTION.
The Q.RESOURCE_TABLE is shipped by IBM with a predefined resource group called SYSTEM. The SYSTEM resource group has three predefined resource options for CICS. Use the CHARVAL column to indicate the limits defined in each row, as shown.
GROUP | OPTION | INTVAL | FLOATVAL | CHARVAL |
---|---|---|---|---|
SYSTEM | SCOPE | - | - | Indicate whether governor is active |
SYSTEM | ROWLIMIT | 100,000 | - | Cancel after fetching 100,000 rows |
SYSTEM | ROWPROMPT | 25,000 | - | Prompt user after fetching 25,000 rows |
Any non-zero value for SCOPE, including a null, deactivates governing for the resource group.
IBM also supplies a view of this table, called Q.RESOURCE_VIEW, that includes all five columns of Q.RESOURCE_TABLE. Each time QMF calls the governor exit routine, QMF passes to the routine the resource control information stored in Q.RESOURCE_VIEW. The governor exit routine uses this resource information to help determine when the user reaches a resource limit.
On a call to the governor exit routine, QMF queries Q.RESOURCE_VIEW, which shows what resource limits are defined in the resource control table for the resource group to which the user belongs. To determine the resource group, QMF checks the value of the RESOURCE_GROUP field of the user's row in the Q.PROFILES table and checks Q.RESOURCE_VIEW for a matching value.
QMF uses two control blocks, DXEGOVA and DXEXCBA, to pass information to the governor exit routine. The DXEGOVA control block contains information from Q.RESOURCE_VIEW about the limits you set for each user. The DXEXCBA control block contains information about the activities the user is performing in the current QMF session, which tells the governor how close the user is coming to the resource limits.
QMF calls the governor exit routine at a number of different points within the QMF session, as shown in Figure 217.
These calls are called function calls. For more information about function calls, see Points at which QMF calls the governor.
When the resource control information QMF passes to the governor exit routine indicates that a resource limit has been reached, the IBM-supplied governor exit routine calls the QMF cancellation service to cancel the QMF activity the user tried to perform.
If you use the default limits for number of rows, the IBM-supplied governor exit routine also displays a warning before canceling the activity, as shown in Figure 213. See Defining your own resource limits for how to activate this warning if you are not using the default values for the number of rows retrieved.
The IBM-supplied governor exit routine resets its count of the number of rows upon returning control to QMF, so that the number of rows is not cumulative across calls to the governor.
This section explains how to create a new resource group, for which the resource is the number of rows retrieved from the database. If you want to define resource limits other than the number of rows, you need to modify the IBM-supplied governor exit routine or write an exit routine of your own. See Modifying the IBM-supplied governor exit routine or writing your own for more information on the facilities you can use.
Use the following procedure to add a resource group to the resource control table. This procedure adds a resource group named GROUP1, where the governor prompts a user in GROUP1 when the number of rows reaches 10, 000, and cancels the user's activity when the number of rows reaches 10,000; it cancels the user's activity when the number of rows reaches 15 ,000. The procedure also shows an example of how to add a user to a resource group.
If you do not want to warn users when they are approaching their limit for the number of rows, skip to step 2
INSERT INTO Q.RESOURCE__VIEW (RESOURCE__GROUP,RESOURCE__OPTION,INTVAL) VALUES('GROUP1','ROWPROMPT',10000)
INSERT INTO Q.RESOURCE__VIEW (RESOURCE__GROUP,RESOURCE__OPTION,INTVAL) VALUES('GROUP1','ROWLIMIT',15000)
INSERT INTO Q.RESOURCE__VIEW (RESOURCE__GROUP,RESOURCE__OPTION,INTVAL) VALUES('GROUP1','SCOPE',0)
UPDATE Q.PROFILES SET RESOURCE__GROUP='GROUP1' WHERE CREATOR='JONES' AND TRANSLATION='ENGLISH'
If you are using an NLF: Use a similar query to update a user's profile in an NLF environment, but use a TRANSLATION value from Table 1.
You can create your own table or rename the Q.RESOURCE_TABLE. You can also include additional columns in the table you create, if Q.RESOURCE_VIEW is the view defined in this table, and if the table includes all of the columns shown in Table 79.
Figure 222 shows an example of SQL statements you might use to create a table called MY_RESOURCES. Substitute your own table, column, and table space names in the query. Before creating a new table, ensure you erase the Q.RESOURCE_TABLE from the database, because Q.RESOURCE_VIEW is defined in this table:
DROP TABLE Q.RESOURCE_TABLE
Dropping the Q.RESOURCE__TABLE also drops Q.RESOURCE_VIEW from the database, so you need to recreate both the table and the view, as shown in Figure 222 and Figure 223. Substitute your own dbspace name for SPACE1.
CREATE TABLE MY_RESOURCES (GROUP_NAME CHAR(16) NOT NULL, CONSTRAINT CHAR(16) NOT NULL, INTEGER INTEGER, FLOAT_VALUE FLOAT, CHARACTER VARCHAR(80)) IN DBSPACE1
Always recreate Q.RESOURCE_VIEW if you decide to use a table other than Q.RESOURCE_TABLE or decide to give Q.RESOURCE__TABLE a different name, because QMF queries the view, not the table, to obtain resource control information to pass to the governor exit routine.
Figure 223 shows how to redefine Q.RESOURCE_VIEW as a view on the new table, MY_RESOURCES. Substitute your own table and column names for those in the figure.
CREATE VIEW Q.RESOURCE_VIEW (RESOURCE_GROUP, RESOURCE_OPTION, INTVAL, FLOATVAL, CHARVAL) AS SELECT GROUPNAME, CONSTRAINT, INTEGER, FLOAT_VALUE, CHARACTER FROM MY_RESOURCES
Column name | Data type | Length (bytes) | Nulls allowed? | Function/values |
---|---|---|---|---|
RESOURCE__GROUP | CHAR | 16 | No | Contains the name of the resource group. Update the RESOURCE__GROUP field of the user's row in Q.PROFILES to activate governing for that user. |
RESOURCE__OPTION | CHAR | 16 | No | Your own name for a resource you want to monitor. |
INTVAL | INTEGER | Yes | Reflects resource limit for resource options that have integer values. For example, number of rows retrieved from the database is a resource that has an integer value. | |
FLOATVAL | FLOAT | Yes | Reflects resource limit for resource options that have floating point values. FLOATVAL is null for the IBM-supplied governor. | |
CHARVAL | VARCHAR | 80 | Yes | Reflects resource limit for resource options that have character values. For example, you might establish a DAY_OF_WEEK resource option and assign MONDAY to CHARVAL so that QMF users can log on to QMF only on Mondays. CHARVAL is used as a comment column in the IBM-supplied governor. |