Specifying use of multiple data set groups in HD and PHD databases
You can specify multiple data set groups to IMS in the DBD. For HDAM databases, use the DATASET statement. For PHDAM databases, use the DSGROUP parameter in the SEGM statement.
You can group the segments any way, but you still must list the segments in hierarchical sequence in the DBD.
The following examples use the database record used in When to use multiple data set groups and HD databases using multiple data set groups. The first example, in the following figure, shows two groups: data set group A contains COURSE and INSTR, data set group B contains all of the other segments. The second example shows a different grouping. Note the differences in DBDs when the groups are not in sequential hierarchical order of the segments.

The following code is the HDAM DBD for the first example. Note that the segments are grouped by the DATASET statements preceding the SEGM statements and that the segments are listed in hierarchical order. In each DATASET statement, the DD1= parameter names the VSAM ESDS or OSAM data set that will be used. Also, each data set group can have its own characteristics, such as device type.
DBD NAME=HDMDSG,ACCESS=HDAM,RMNAME=(DFSHDC40,8,500)
DSA DATASET DD1=DS1DD
SEGM NAME=COURSE,BYTES=50,PTR=T
FIELD NAME=(CODCOURSE,SEQ),BYTES=10,START=1
SEGM NAME=INSTR,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
DSB DATASET DD1=DS2DD,DEVICE=2314
SEGM NAME=REPORT,BYTES=50,PTR=T,PARENT=((INSTR,SNGL))
SEGM NAME=LOC,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
SEGM NAME=STUDENT,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
SEGM NAME=GRADE,BYTES=50,PTR=T,PARENT=((STUDENT,SNGL))
DBDGEN
DBD NAME=HDMDSG,ACCESS=PHDAM,RMNAME=(DFSHDC40,8,500)
SEGM NAME=COURSE,BYTES=50,PTR=T
FIELD NAME=(CODCOURSE,SEQ),BYTES=10,START=1
SEGM NAME=INSTR,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
SEGM NAME=REPORT,BYTES=50,PTR=T,PARENT=((INSTR,SNGL)),DSGROUP=B
SEGM NAME=LOC,BYTES=50,PTR=T,PARENT=((COURSE,SNGL)),DSGROUP=B
SEGM NAME=STUDENT,BYTES=50,PTR=T,PARENT=((COURSE,SNGL)),DSGROUP=B
SEGM NAME=GRADE,BYTES=50,PTR=T,PARENT=((STUDENT,SNGL)),DSGROUP=B
DBDGENThe second example, in the following figure, differs from the first example in that the groups do not follow the order of the hierarchical sequence. The segments must be listed in the DBD in hierarchical sequence, so additional DATASET statements or DSGROUP parameters are required.

The following code is the DBD for an HDAM database of the second example. It is similar to the first example, except that because the sixth segment is part of the first group, you need another DATASET statement before it with the DSA label. The additional DATASET label groups the sixth segment with the first three.
DBD NAME=HDMDSG,ACCESS=HDAM,RMNAME=(DFSHDC40,8,500)
DSA DATASET DD1=DS1DD
SEGM NAME=COURSE,BYTES=50,PTR=T
FIELD NAME=(CODCOURSE,SEQ),BYTES=10,START=1
SEGM NAME=INSTR,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
SEGM NAME=REPORT,BYTES=50,PTR=T,PARENT=((INSTR,SNGL))
DSB DATASET DD1=DS2DD,DEVICE=2314
SEGM NAME=LOC,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
SEGM NAME=STUDENT,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
DSA DATASET DD1=DS1DD
SEGM NAME=GRADE,BYTES=50,PTR=T,PARENT=((STUDENT,SNGL))
DBDGEN The following code is the DBD for a PHDAM database of the second example. It is similar to the first example, except that because the sixth segment is part of the first group, you must explicitly group it with the first two segments by using the DSGROUP parameter.
DBD NAME=HDMDSG,ACCESS=PHDAM,RMNAME=(DFSHDC40,8,500)
SEGM NAME=COURSE,BYTES=50,PTR=T
FIELD NAME=(CODCOURSE,SEQ),BYTES=10,START=1
SEGM NAME=INSTR,BYTES=50,PTR=T,PARENT=((COURSE,SNGL))
SEGM NAME=REPORT,BYTES=50,PTR=T,PARENT=((INSTR,SNGL)),
SEGM NAME=LOC,BYTES=50,PTR=T,PARENT=((COURSE,SNGL)),DSGROUP=B
SEGM NAME=STUDENT,BYTES=50,PTR=T,PARENT=((COURSE,SNGL)),DSGROUP=B
SEGM NAME=GRADE,BYTES=50,PTR=T,PARENT=((STUDENT,SNGL)),DSGROUP=A
DBDGEN