Multiple index entries for Fast Path secondary indexes
You can create multiple Fast Path secondary index entries from different fields in the same source segment.
More than one search field can be defined for a secondary index from fields in the same source segment. Each search field (or set of search fields) is used to create an entry in the secondary index. These search fields (or sets of search fields) must each be the same size.
To create multiple index entries from a single source segment, define two or more LCHILD/XDFLD statement pairs under the SEGM statement of a target segment and specify the MULTISEG=YES on the LCHILD statement.
In the following DEDB, there are three fields for telephone numbers in the OWNER segment.
DBD NAME=ACCTDB,ACCESS=DEDB,RMNAME=RMD4
AREA DD1=ACCT1,SIZE=1024,UOW=(100,10),
ROOT=(236,36)
SEGM NAME=ACCT,PARENT=0,BYTES=100
FIELD NAME=(ACCTNO,SEQ,U),BYTES=12,START=1
LCHILD NAME=(PHONKEY,PHONINDX),PTR=SYMB,MULTISEG=YES
XDFLD NAME=XPHON,SEGMENT=OWNER,SRCH=HOMEPHN
LCHILD NAME=(PHONKEY,PHONINDX),PTR=SYMB,MULTISEG=YES
XDFLD NAME=XPHON,SEGMENT=OWNER,SRCH=WORKPHN
LCHILD NAME=(PHONKEY,PHONINDX),PTR=SYMB,MULTISEG=YES
XDFLD NAME=XPHON,SEGMENT=OWNER,SRCH=CELLPHN
SEGM NAME=OWNER,BYTES=300,PARENT=ACCT
FIELD NAME=OWNNAME,BYTES=40,START=1
FIELD NAME=HOMEPHN,BYTES=10,START=41
FIELD NAME=WORKPHN,BYTES=10,START=51
FIELD NAME=CELLPHN,BYTES=10,START=61
DBDGEN
The secondary index DBD for this example is:
DBDSX DBD NAME=PHONINDX,ACCESS=(INDEX,VSAM),FPINDEX=YES
DATASET DD1=PHONKSDS,OVFLW=PHONOVFL
SEGM NAME=PHONSEG,PARENT=0,BYTES=22
FIELD NAME=(PHONEKEY,SEQ,U),BYTES=10,START=1
LCHILD NAME=(OWNER,ACCTDB),INDEX=XPHON,PTR=SYMB
DBDGEN