minmaxdv Routine--Provide Min/Max Values and Lengths
The minmaxdv routine provides the minimum and maximum values and lengths for a data type.
Place the address of this routine in the dtd_minmaxdv_addr field of the IIADD_DT_DFN structure. If the II_DT_NOHISTOGRAM attribute is present, then this routine is not necessary.
Depending on the input parameters, the routine returns one or both of the following:
• Its minimum and/or maximum value
• Its minimum and/or maximum length
The two input parameters are min_dv and max_dv; both are pointers to II_DATA_VALUEs. The lengths specified (db_length) for each may be different, but their data types (db_datatype) must be the same.
The routine uses the following rules to process these inputs:
If an input is NULL, then processing for that input is not performed. This allows the caller who is interested in only the maximum value or only the minimum to use this routine more efficiently.
If the db_length field of an input is supplied as II_LEN_UNKNOWN, no corresponding value is built and placed at the output's db_data field. Instead, the routine returns the valid internal length to the db_length field.
If the db_data field of an input is NULL, then no value is built and placed at the corresponding output's db_data field.
If none of rules 1-3 apply to an input, then the value for the data type and length is built and placed at db_data.
Inputs
The inputs for this function are:
scb
Pointer to an SCB.
min_dv
Pointer to II_DATA_VALUE for the 'min'. If this is NULL, 'min' processing is skipped:
db_datatype
Its data type. Must be the same as data type for 'max'.
db_length
The length to build the 'min' value for, or II_LEN_UNKNOWN, if the 'min' length is requested.
db_data
Pointer to location to place the 'min' non-null value, if requested. If this is NULL no 'min' value is created.
max_dv
Pointer to II_DATA_VALUE for the 'max'. If this is NULL, 'max' processing is skipped:
db_datatype
Its data type. Must be the same as data type for 'min'.
db_length
The length to build the 'max' value for, or II_LEN_UNKNOWN, if the 'max' length is requested.
db_data
Pointer to location to place the 'max' non-null value, if requested. If this is NULL no 'max' value is created.
Outputs
The outputs for this function are:
min_dv
If this was supplied as NULL, 'min' processing is skipped.
db_length
If this was supplied as II_LEN_UNKNOWN, the 'min' valid internal length for this data type is returned.
db_data
If this was supplied as NULL, or if the db_length field was supplied as II_LEN_UNKNOWN, nothing is returned. Otherwise, the 'min' non-null value for this data type and length is built and placed at the location pointed to by db_data.
max_dv
If this was supplied as NULL, 'max' processing is skipped.
db_length
If this was supplied as II_LEN_UNKNOWN, the 'max' valid internal length for this data type is returned.
db_data
If this was supplied as NULL, or if the db_length field was supplied as II_LEN_UNKNOWN, nothing is returned. Otherwise, the 'max' non-null value for this data type and length is built and placed at the location pointed to by db_data.
Returns
II_STATUS
Last modified date: 11/09/2022