Previous Topic: HDAM AccessNext Topic: Secondary Indexing (Index Databases)


HIDAM Access

What HIDAM Provides

The HIDAM access method provides indexed access to root segments, via the root sequence field, and pointer access to child segments. The index contains the root segment sequence field values and is maintained in ascending order.

A HIDAM database is made up of two separate databases. One database contains all of the data. The other database is the index and contains the sequence field values for the root segment occurrences.

Index Database

The index database is never visible to an application, but it must be defined in its own set of DBD statements. A HIDAM index database requires the value INDEX for the ACCESS parameter in the DBD statement. The illustration below shows the DBD source statements for a HIDAM physical database (DB1) and its associated index database (DBINDEX).

 DBD      NAME=DB1,ACCESS=HIDAM
 DATASET  DD1=DBHIDAM,DEVICE=3350,BLOCK=42,RECORD=48,SCAN=1
 
 SEGM     NAME=SEG1,BYTES=31,PTR=H,PARENT=0
 
 FIELD    NAME=(FIELD1,SEQ,U),BYTES=21,START=1
 FIELD    NAME=FIELD2,BYTES=10,START=22
 LCHILD   NAME=(SEG2,DBINDEX),PTR=INDX
 DBDGEN
 FINISH
 END



 DBD      NAME=DBINDEX,ACCESS=INDEX
 DATASET  DD1=DBINDEX,DEVICE=3350,BLOCK=44,RECORD=46,SCAN=1
 SEGM     NAME=SEG2,BYTES=21
 
 LCHILD   NAME=(SEG1,DB1),INDEX=FIELD1
 
 FIELD    NAME=(FIELD3,SEQ,U),BYTES=21,START=1
 DBDGEN
 FINISH
 END

Figure 14. DBD definitions for a HIDAM database and its index database

Index Pointer Segments

An index database can contain only one segment, which is referred to as the index pointer segment. The single SEGM statement in the index DBD names this segment. The index pointer segment points to the root segment in the physical DBD. The root segment is referred to as the source segment because it is the source of the data needed to construct the index pointer segment. The root segment is also the target segment because it is the segment that will be accessed by the index pointer. The index pointer segment contains one field, which will carry the sequence field values for the root segment occurrences. This field must also be defined as a sequence field.

LCHILD Statement Associates Databases

The physical (HIDAM) DBD and the index DBD both contain an LCHILD statement. Together, the two LCHILD statements establish the association between the databases. The NAME parameter in the physical DBD's LCHILD statement specifies the index pointer segment and the index DBD in which it is defined. The NAME parameter in the index DBD's LCHILD statement specifies the root segment and the physical DBD in which it is defined. The INDEX parameter in the index DBD's LCHILD statement specifies the sequence field in the named root segment.

The HIDAM method supports all of the DL/I hierarchical and logical relationships.