Request Statistics Collections (QDBSTRS, QdbstRequestStatistics) API


  Required Parameter Group:


  Service Program Name: QDBSTMGR

  Default Public Authority: *USE

  Threadsafe: Yes

The Request Statistics Collections (QDBSTRS, QdbstRequestStatistics) API allows the user to request one or more statistics collections for a given set of columns of a database file member to be created.

The created statistics collections are stored as part of the database file member.

Options are provided to control whether the statistics are generated in the background or to be processed immediately, and whether the status of the resulting statistics collections is to be maintained automatically by the system or manually by the user.


Section overview


Authorities and Locks

ASP Device Authority
*EXECUTE
File Authority
*OBJALTER, *OBJOPR
File Library Authority
*EXECUTE
File Lock
*SHRRD
Translation Table Authority
*USE
Translation Table Library Authority
*EXECUTE
Translation Table Lock
*SHRRD

Required Parameter Group

Input data
INPUT; CHAR(*)

The buffer containing the input parameters according to the Format of input data parameter. The buffer content has to start at a four-byte boundary.

Length of input data
INPUT; BINARY(4)

The length of the input data buffer provided.

Format of input data
INPUT; CHAR(8)

The format of the input data. Possible values are:

Refer to STIR0100 Input Format for more information.

Feedback area
OUTPUT; CHAR(*)

The buffer to receive feedback data. See Feedback Area Format for more information. The buffer content has to start at a four-byte boundary.

Length of feedback area
INPUT; BINARY(4)

The length of the feedback area buffer provided. The required minimum length is 16, to fit the feedback area header (see Feedback Area Format).

Feedback keys
INPUT; ARRAY(*) OF BINARY(4)

The list of fields to return in the feedback area. For a list of valid keys see Valid Keys - Feedback.

Number of feedback keys
INPUT; BINARY(4)

The number of fields to return in the feedback area. If zero is specified, all other feedback area parameters (Feedback area, Length of feedback area, and Feedback keys) are ignored.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


STIR0100 Input Format

The basic request statistics collections input parameters. See Field Descriptions for details of the fields listed.

The fields below follow the fields above and repeat, in the order listed, for each statistics collection, where the first statistics collection starts at the given Offset to statistics collections.

The fields below follow for each statistics collection definition header structure as described above and repeat, in the order listed, for each column in the current statistics collection, where the data for the first column starts at the given offset Offset to columns.



Valid Keys - Feedback

Use the following keys to specify the fields to be returned in the feedback area. Each key can only be specified once. See Field Descriptions for details of the fields listed.



Feedback Area Format

The fields returned in the feedback area will be returned in the order requested. See Field Descriptions for details of the fields listed.



Field Descriptions

Aging mode. Whether the system is allowed to age or remove the resulting collected statistics collection. The possible values are:

ASP device name. The name of one auxiliary storage pool (ASP) device in the ASP group in which the library and file are located. The ASP device must have a status of 'Available'. The documented authority is required for the given ASP and the primary of the corresponding ASP group. The name can be a specific ASP device name (for an ASP with a number greater than 32), or one of the following special values:

ASP device name used. The actual auxiliary storage pool device name used, after possible resolution of special values.

Collection mode. Where the processing for the statistics collection will be performed, or if merely an estimate is requested. The possible values are:

Column name. The name of a single column within a single statistics collection definition.

Data. The data returned for the key identifier.

Displacement to columns. Displacement to the start of the list of column definitions for the current statistics collection definition.

Elapsed time. When the collection mode specified is *IMMEDIATE, the value represents the number of seconds actually spent processing the requested statistics collection.

For any other collection mode, this value represents the estimated time in seconds, that the statistics collection should take.

File library name. Where the file for which statistics collections are being requested is located. You can use these special values for the library name, if the ASP Device Name is *:

File library name used. The actual file library name used, after possible resolution of special values.

File member name. The name of the file member to be used for the statistics collections request.

This value can be a specific file member name or one of the following special values:

File member name used. The actual file member name used, after possible resolution of special values.

File name. The name of the file for which statistics collections are being requested. The file has to be an existing local, single format, physical file.

Internal request ID. For a Collection mode of *BACKGROUND only, this field is an unique ID for the complete list of statistics collections requested here. The request ID stays valid until the request is completed and the ID can be used on the Cancel Requested Statistics Collections (QDBSTCRS, QdbstCancelRequestedStatistics) API.

Note: The ID is stored in binary, non printable form in the character array.

Internal statistics IDs created. For a Collection mode of *IMMEDIATE only, this will return an array of the internal statistics ID created for each of the requested and successfully created statistics collections. This statistics ID together with the qualified member name can serve as a unique identifier for the created statistics collection on the input to the QdbstDeleteStatistics, QdbstUpdateStatistics, and QdbstListDetailStatistics APIs. Each ID is returned as a single key value. The single key values will be returned in sequence and in the order the statistics collections were requested in the input format. The array dimension can be determined either by the input format field Number of statistics collections or by requesting this number again as Total number of statistics collections for internal request ID in the feedback.

Note: The internal statistics ID for a statistics collection is also returned on the QdbstListStatistics API.

Note: The ID is stored in binary, non printable form in the character array.

Key identifier. The field returned. For a list of valid keys see Valid Keys - Feedback.

Length of column definition. Length of this column definition.

Length of data. The length of the data returned for the field.

Length of field information returned. Total number of bytes returned for this field in the feedback area.

Length of statistics collection. Length of this statistics collection definition, which can be used to get to the next definition.

Note: The length includes all the column definitions for this statistics collections.

Length of statistics collection name. Actual length of the statistics collection name, up to the maximum length of 128 characters.

Number of bytes available. Number of bytes that could be returned in the feedback area.

Number of bytes returned. Number of bytes returned in the feedback area.

Number of columns. Number of columns in a single statistics collection definition.

Note: This number must be 1.

Number of key fields available. Number of fields that could be returned in the feedback area.

Number of key fields returned. Number of fields returned in the feedback area.

Number of statistics collections. Number of statistics collection definitions for this request.

Offset to statistics collections. Offset to the start of the list of statistics collection definitions for this request.

Reserved. Reserved for future use. If this field is input, the field must be set to hexadecimal zeros.

Reserved (in feedback area format). Structure padding to guarantee alignment to the next four bytes boundary.

Statistics collection names used. An array of the statistics collection names used. Each name is returned as a single key value and is either the name specified on input, or the system generated name, if the special value *GEN was used on input and if the Collection mode specified is *IMMEDIATE. The single key values will be returned in sequence and in the order the statistics collections were requested in the input format. The array dimension can be determined either by the input format field Number of statistics collections or by requesting this number again as Total number of statistics collections for internal request ID in the feedback.

Statistics collection name. A name unique amongst all statistics collections for the file member. The following special value can be used:

Note: The name is given in varying length form, where the actual length is passed in the Length of statistics collection name field, to indicate how many of the 128 characters are actually part of the name text.

Total number of statistics collections for internal request ID. Number of statistics collection definitions for this request. Gives the array dimension of Statistics collection names used and Internal statistics IDs created and is a copy of Number of statistics collections in the input format.

Translation table name. This field is relevant just for character columns and must be all blanks otherwise. For character columns, this is the name of a translation table to be applied to the data in this column. The name must be for an existing translation table, or all blanks, if no translation table is to be applied. The Translation table name can also have the following special values: *JOB indicates the value is retrieved from the job; *LANGIDUNQ indicates the unique weight table that corresponds to the LANGID specified in the Translation table library name field is used; *LANGIDSHR indicates the shared weight table that corresponds to the LANGID specified in the Translation table library name field is used; *NONE indicates a translate table is not used.

Translation table library name. Where the translation table is located. The name must be for an existing library or all blanks, if no translation table is to be applied. If the Translation table name field contains the special value of *LANGIDUNQ or *LANGIDSHR, then the Translation table library name field must contain a corresponding language identifier (LANGID).

If none of the special values are used for the Translation table name field, you can use these special values for the library name:



Error Messages



Related Information



API introduced: V5R2

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