Start of change

ADB2ME2 stored procedure

The ADB2ME2 stored procedure returns the estimated number of extents needed for a table space or index space based on the provided input parameter values. This REXX stored procedure invokes the space estimator feature of Db2 Admin Tool and corresponds to the functionality provided on the DB2 Extents Estimator (ADB2ME2) panel.

Environment

The ADB2ME2 stored procedure runs in a WLM-established stored procedure address space. For setup instructions, see Setting up the provided REST APIs.

Authorization

To execute the CALL statement, the owner of the package or plan that contains the CALL statement must have EXECUTE privilege on the ADB2ME2 stored procedure.

Syntax

Read syntax diagramSkip visual syntax diagram CALL ADB2ME2 ( priqty,secqty,estkb,unittype,res)

Input parameters

priqty
The primary space allocation in kilobytes (KB).
Type:
BIGINT
secqty
The secondary space allocation in KB.
Type:
BIGINT
estkb
The estimated number of KB required for the table space.
Type:
BIGINT
unittype
The unit type. This value is used when calculating the estimated number of tracks and cylinders.
Type:
VARCHAR(10)
Acceptable values:
3380
3390

Output parameters

res
A string that contains the output data. The string contains the return code, the space estimates, and a completion message, as shown in the following example res string:
"rc\":0,\"estext\":2,\"pqinexpl\":\"(1 track)\",\"sqinexpl\":\"(1 track)\",\"msg\":\"Successful completion\"
Within this string, a backslash (\) is used as an escape character for the quotation marks ("). The estimate values in this string correspond to fields on the DB2 Extents Estimator (ADB2ME2) panel as follows:
Table 1. res estimate values
Value in res string Corresponding estimates field on the DB2 Extents Estimator (ADB2ME2) panel
estext Estimated extents
pqinexpl PRIQTY (the second value in parentheses, for example 2 cyls)
sqinexpl SECQTY (the second value in parentheses, for example, 1 track)
Type:
VARCHAR

Examples

The following example CALL statement returns an extent estimate given the specified input parameters:
CALL ADB2ME2(2417483647, 2417483647, 214, '3390', :RES);
The following example CALL statement in an application program passes host variables as the input parameters and returns an extent estimate based on those variable values at the time the application is run.
CALL ADB2ME2(:PRIQTY, :SECQTY, :ESTKB, :UNITTYPE, :RES);
End of change