When Data Base Administrator (DBA) designs a data base, a number of factors must be considered. The factors to be considered are,
What are the names of the segments that can be accessed?
What are the formats of the various fields within those segments?
What are the hierarchical relationships among the segments?
What kind of processing can be performed on the segments?
What are the hierarchical relationships that best fit the needs of the applications that will access the data base?
Which physical access methods provide the best level of efficiency and storage economy for the data base?
How often should the data base be reorganized?
What kinds of data security should be built into the system?
A Key or Sequence field is a field within a segment selected to identify which occurrence the segment is, i.e., maintains segments in ascending sequence. Only a single field within each segment can be designated as a key or sequence field. However, segments are generally not required to have a key or sequence field. Sequence fields can be designated as unique or nonunique.
To search for a segment based on the contents of some field, but the segments should not be sequenced on that field, the field can be designated as a Search Field.
Once segments have been defined, the hierarchical structure decided upon, and key & search fields chosen, the Data Base Administrator communicates this information to IMS. To do this a control block is created in a IMS library, called Data Base Description.
. It describes the physical nature of a data base. A process called DBD generation (DBDGEN) is used to create DBD. The DBA creates a DBD by coding a series of DBDGEN control statements.
The DBDGEN process is as shown in the above diagram. DBDGEN control statements are shown below for the Customer data base.
PRINT NOGEN DBD NAME=CUSTDBD,ACCESS=HIDAM DATASET DD1=CUST,DEVICE=3350 SEGM NAME=CUSTOMER,PARENT=0,BYTES=128 FIELD NAME=(CUSTNUM,SEQ,U),BYTES=6,START=1,TYPE=C FIELD NAME=CUSTNAME,BYTES=31,START=7,TYPE=C FIELD NAME=CSTADD1,BYTES=31,START=38,TYPE=C FIELD NAME=CSTADD2,BYTES=31,START=69,TYPE=C FIELD NAME=CUSTCITY,BYTES=18,START=100,TYPE=C FIELD NAME=CSTSTATE,BYTES=2,START=118,TYPE=C FIELD NAME=CUSTZIP,BYTES=9,START=120,TYPE=C SEGM NAME=SHIPTO,PARENT=CUSTOMER,BYTES=124 FIELD NAME=(SHPTOSEQ,SEQ,U),BYTES=2,START=1,TYPE=C FIELD NAME=SHIPNAME,BYTES=31,START=3,TYPE=C FIELD NAME=SHIPADD1,BYTES=31,START=34,TYPE=C FIELD NAME=SHIPADD2,BYTES=31,START=65,TYPE=C FIELD NAME=SHIPCITY,BYTES=18,START=96,TYPE=C FIELD NAME=SHPSTATE,BYTES=2,START=114,TYPE=C FIELD NAME=SHIPZIP,BYTES=9,START=116,TYPE=C SEGM NAME=BUYER,PARENT=SHIPTO,BYTES=72 FIELD NAME=BUYRNAME,BYTES=31,START=1,TYPE=C FIELD NAME=BUYTITLE,BYTES=31,START=32,TYPE=C FIELD NAME=BUYTELPH,BYTES=10,START=63,TYPE=C SEGM NAME=RECVABLE,PARENT=SHIPTO,BYTES=57 FIELD NAME=(RSINVNUM,SEQ,U),BYTES=6,START=1,TYPE=C FIELD NAME=RSINDATE,BYTES=6,START=7,TYPE=C FIELD NAME=RSPONUM,BYTES=25,START=13,TYPE=C FIELD NAME=RSPRDTOT,BYTES=4,START=38,TYPE=P FIELD NAME=RCASHDIS,BYTES=4,START=42,TYPE=P FIELD NAME=RSSLSTAX,BYTES=4,START=46,TYPE=P FIELD NAME=RFREIGHT,BYTES=4,START=50,TYPE=P FIELD NAME=RSBALDUE,BYTES=4,START=54,TYPE=P SEGM NAME=PAYMENT,PARENT=RECVABLE,BYTES=51 FIELD NAME=(PSCHKNUM,SEQ,U),BYTES=16,START=1,TYPE=C FIELD NAME=PSBNKNUM,BYTES=25,START=17,TYPE=C FIELD NAME=PAYDATE,BYTES=6,START=42,TYPE=C FIELD NAME=RSPAYAMT,BYTES=4,START=48,TYPE=P SEGM NAME=ADJSTMNT,PARENT=RECVABLE,BYTES=17 FIELD NAME=(ASREFNUM,SEQ,U),BYTES=6,START=1,TYPE=C FIELD NAME=AADJDATE,BYTES=6,START=7,TYPE=C FIELD NAME=AADJTYPE,BYTES=1,START=13,TYPE=C FIELD NAME=ASADJAMT,BYTES=4,START=14,TYPE=P SEGM NAME=LINEITEM,PARENT=RECVABLE,BYTES=16 FIELD NAME=(ITKEYVEN,SEQ,U),BYTES=3,START=1,TYPE=C FIELD NAME=ITKEYNUM,BYTES=5,START=4,TYPE=C FIELD NAME=LIUNTPRC,BYTES=4,START=9,TYPE=P FIELD NAME=LIQUANTY,BYTES=4,START=13,TYPE=P DBDGEN FINISH END |
DBDGEN control statements consist of assembler language macro statements. The macros are supplied by IBM in a library named some thing like IMSVS.MACLIB. DBDGEN control statements are normally coded by the DBA and submitted to the system with JCL that invokes a cataloged procedure usually called DBDGEN.
The DBDGEN process causes the DBDGEN control statements to be processed by the assembler producing an object module. The object module is then passed to the linkage editor which in turn stores a load module in another library. (IMS.DBDLIB) This load module is the DBD which can be loaded into the storage.
In FIELD statements, NAME operands contain from one to three positional subparameters. The first parameter gives a name to the key or search field. If it is the only subparameter coded, the field is a Search Field.
If the characters SEQ are coded in the second position, the field is a Key or Sequence Field. Only one of these is allowed per SEGM statement. If a U is coded in third position, the field is a unique sequence field.
Various FIELD macro TYPE parameter codes available are :
C - Character
P - Packed Decimal
Z - Zoned Decimal
X - Hexadecimal
H - Halfword Binary
F - Full word Binary
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!