Both the index number and Storage Area Name and number can be found in the Index analysis report which can be run online or offline:
$ proutil <dbname> -C idxanalys >> idx.out
The
_storageobject VST can be used to join information from the _area, _file and _index metaschema:
DEFINE VARIABLE cTableName AS CHARACTER FORMAT 'X(30)' LABEL 'Table Name'.
UPDATE cTableName WITH SIDE-LABELS.
FIND _file WHERE _file-name = cTableName NO-LOCK NO-ERROR.
IF NOT AVAILABLE(_file) THEN MESSAGE "Table does not exist" VIEW-AS ALERT-BOX.
ELSE DO:
FIND _storageobject WHERE _storageobject._object-type = 1 AND _storageobject._object-number = _file._file-num NO-LOCK NO-ERROR.
FIND _Area WHERE _Area._Area-number = _storageobject._Area-number NO-LOCK NO-ERROR.
DISPLAY _Area-name _Storageobject._Area-number.
FOR EACH _index OF _file:
FIND _storageobject WHERE _storageobject._object-type = 2 AND _storageobject._object-number = _index._idx-num NO-LOCK NO-ERROR.
FIND _Area WHERE _Area._Area-number = _storageobject._Area-number NO-LOCK NO-ERROR.
DISPLAY _index-name FORMAT 'x(15)'
_Area-name FORMAT 'x(15)'
_Storageobject._Area-number FORMAT "->>9"
_Storageobject._Object-root LABEL "Root Block" FORMAT "->>>>9"
_Storageobject._Object-number LABEL "Index Number" FORMAT "->>9".
END.
END.
Alternatively; query _file and _index directly:
DEFINE VARIABLE i AS CHAR NO-UNDO.
SET i LABEL "TABLE NAME" WITH FRAME A.
FIND FIRST _file WHERE _file._file-name = i NO-LOCK.
IF AVAILABLE _file THEN DO:
FOR EACH _index OF _file:
DISPLAY _index._index-name FORMAT "X(13)"
_index._idx-num
_index._unique
_index._Active
_index._Wordidx SKIP.
END.
END.
When the tablenumber or indexnumber are known, DBRPR report:
$ proutil dbname -C dbrpr
P. Print Info Menu
1. Print ObjectTables
Example: DBRPR ObjectTables.lst report:
Index-Table
Number Partition Root AreaNum TableArea
12 X 96 10 9
13 X 128 10 9
14 X 160 10 9
15 X 192 10 9
16 X 224 10 9