RID values in messages

Various messages return a 7-byte RID (record identifier) value that identifies the row that encountered the error.

For example, the following message might return X'00070070EC8104' for rid-value.

DSNU733I csect-name ROW (RID=X'00070070EC8104') HAS NO PARENT FOR relationship-identifier

Comparing message RID values to results from the RID built-in function

To help resolve an error situation you might want to compare a RID value returned in a message with a RID value returned by the RID built-in function.

  1. Determine whether the table space that contains the table that resulted in the error message uses relative or absolute page numbering.
    1. Use the name of the table that resulted in the message, to query the SYSTABLES catalog table to find the name of the containing table space. For a DSNU733I message, the preceding DSNU730I message identifies the table.
    2. Use the name of the table space to query the SYSTABLESPACES catalog table for the PAGENUM value. The PAGENUM column indicates the type of page numbering that the table space uses. If the PAGENUM value is 'A', absolute page numbering is used. If the value is 'R', relative page numbering is used.
  2. Convert the RID value returned in the message for comparison to a value returned by the RID function. The conversions required depend on the type of page numbering and whether a numeric or string comparison is used.

    For example, assume that X'00070070EC8104' is the RID value returned in a message.

    Start of change

    FL 505 You can use the INTEPRET function. For example, you might use the following function invocation to interpret the example RID value. The INTERPET function requires an 8-byte value, so you need to pad the 7-byte value returned by the message with an additional BX'00' on the left. The result is 7698475942148.

    INTERPRET(BX'0000070070EC8104' AS BIGINT)

    For more information, see INTERPRET scalar function.

    End of change

    The following table shows other conversions that you can use for the comparisons. Although the example predicates use built-in functions to illustrate the required conversions, you might prefer to do these conversions separately on your own.

    Also, keep in mind that invoking built-in functions for large tables can result in costly table space scans. Although, the example predicates use built-in functions to illustrate the required conversions, you might prefer to do these conversions separately on your own.

    For the numeric comparisons, you might also need to use a calculator to convert the RID value returned in the message (which is hexadecimal) to a numeric value.

    For string comparisons, both operands must have the same length (eight bytes) because the values are compared as varying length character strings. Otherwise, if the operands are of unequal lengths the shorter string is padded with character blanks and the comparison is false.

    Page Numbering Comparison Type Predicate Example
    Absolute Numeric Compare result of the RID function to the result of converting the last five-bytes of the RID returned in the message (X’0070EC8104’ ) to a numeric value.
    RID(E) = 1894547716
    Absolute String Compare the hex representation of the result of the RID function with '000000' concatenated in front of the last five bytes of the RID returned in the message.
    HEX(RID(E)) = CONCAT ('000000', '0070EC8104')
    Relative Numeric Compare the result of the RID function to the result of converting the 7-byte RID returned in the message (X’00070070EC8104’) to a numeric value.
    RID(E) = 7698475942148
    Relative String Compare the hex representation of the result of the RID function to '00' concatenated in front of the 7-byte RID returned in the message.
    HEX(RID(E)) = CONCAT ('00', '00070070EC8104')