With simple indexing, z/TPFDF uses an LREC in one file, the index file, to point to
(reference) a subfile in another file, called the detail file.
Figure 1 shows an example of an index file that contains index LRECs; these
LRECs reference the subfiles in a detail file.
In this example, there is only one ordinal in the index file, so algorithm #TPFDB04 is used. The
detail file contains two sets of LRECs. It is organized in ascending order (UP organized) by the
LREC ID (PKY=).
The LRECs in LREC ID X'80' are further organized in ascending order on field GR25DF2. The LRECs
in LREC ID X'90' are organized in descending order (DOWN organized). Figure 1. File description for simple indexing
DBDEFs
Top-level index file
DBDEF FILE=GR50DF, file GR50DF -
(PKY=#GR50K80, primary key X'80' -
KEY1=(PKY=#GR50K80,UP), - default keys -
KEY2=(R=GR50DF1,UP)), -
(ITK=#GR50K80, forward path, index LREC -
ID2=, type of reference -
INDEX=(GR25DF,0)) indexed file, index slot 0
Detail file
DBDEF FILE=GR25DF, file GR25DF -
(PKY=#GR25K80, primary key X'80' -
KEY1=(PKY=#GR25K80,UP), - default keys -
KEY2=(R=GR25DF2,UP)), -
(PKY=#GR25K90, primary key X'90' -
KEY1=(PKY=#GR25K90,UP), - default keys -
KEY2=(R=GR25DF3,DOWN)), -
(IID=GR50DF, backward path, default path 0 -
IKY=#GR50K80, index LREC -
IPA=0, offset of addressing argument -
ILA=0, length of addressing argument -
IPK=0, offset of index key -
ILK=4, length of index key -
KEY1=(PKY=#GR50K80,UP), search keys for index -
KEY2=(R=GR50DF1,S=0,UP)) default length assumed