Kbase P31638: How to convert a RECID to a Database Block number using Rec Bits?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/10/2008 |
|
Status: Verified
GOAL:
How to convert a RECID to a Database Block Number using RECID and Rec Bits?
GOAL:
How to convert a RECID to a database block number?
GOAL:
How to determine database block number by recid?
GOAL:
How to determine DBKey using RECID?
FIX:
To convert a RECID to a database block number you need to know the
following information:
1. RECID
The RECID will either be available due to your receiving an error
which reports the recid or the result of running code using the RECID
statement to identify a specific recid.
2. Table and area that the RECID is located in.
To determine the table and Area that a RECID is located in, please use
solution:
P29346, "How to determine what Table and Area a RECID exists in?"
3. # of Rec Bits for the Area in the Database..
To determine the Rec Bits, use the following code when connected to the
database:
FOR EACH _Area WHERE _Area-number > 0.
DISPLAY _Area-name _Area-recbits _Area-Blocksize.
Output looks like the following:
Area-name _Area-recbits Area-blocksize
-----------------------------------------------------------
Control Area 6 8192
Primary Recovery Area 0 8192
Schema Area 6 8192
New Area 6 8192
Formula to calculate addressable Database Block is:
a. RECID converted to binary
b. Remove # of Rec Bits from the right hand side of the binary number
c. Convert the binary number back to decimal
Example: RECID = 5305
Converted to binary = 1010010111001
Rec Bits = 6 - therefore remove 6 digits from the right = 1010010
Convert that value to decimal = 82
The addressable Database Block # is 82.
To determine DBKey take the Database Block # and multiply by # of
records per block.
Example: Database Block # = 82
# of Records per Block is 64
82 x 64 = 5248 DBKey