IMS DB Control Blocks DBDGEN IMS Training Class
IMS DB Control Blocks DBDGEN IMS Training Class 02 www. mainframes-online-training. weebly. com Polsani Anil Kumar
Working with IMS Database Before we run our database programs, several steps need to be followed. These include: § DBDGEN Define the database segments § PSBGEN Define the PSB details § ACBGEN Needed for online § Compile, and link edit the application program § Execute DFSRRC 00 for batch initialisation
Execution Flow
Introduction to Control Blocks § There are three main DL/I control blocks, one describing the database structure, the other identifying how the database may be accessed by the program and the third for execution purpose (only for online). § They are § Database Descriptor (DBD) § Program Specification Block (PSB) § Application Control Block (ACB) § The Database Administration Group normally maintains these control blocks.
Introduction to DBD , PSB & ACB § DBD describes the physical structure of a database as well as the way in which it is stored on the DASD and the way it is accessed § PSB describes the Logical Structure of a Database as a particular application program views it. It identifies which pieces of data a program is allowed to access and the kinds of functions (operations) it can perform on each collection of data. § ACB combines the information present in DBD and PSB before the execution could begin. The use of ACB is optional for Batch DL/I programs, but is required for MPP and BMP programs.
Data Base description (DBD) The DBD contains the name of the database and defines the actual tree structure. The information needed by application programmer includes: Database name , Segment names , lengths and locations Key field names, Data Base description (DBD) describes physical structure of the database The DBD also contains the IMS and MVS access methods and defines how many datasets and DD statements are required. The DDNAMES for the database are also found in the DBDs are assembled (DBDGEN) and reside in DBDLIBs.
Process of Creating DBD § DBD is created by a process called DBD Generation or DBDGEN, this process is performed only once for database § DBDGEN control statements are Assembler Language Macros supplied by IBM and submitted via JCL invoking a catalogued procedure called DBDGEN producing an Load module. § Macros are stored in MACLIB and load modules are stored in DBDLIB, which is the DBD itself and ready for loading
Sample DBDGEN Code PRINT NOGEN DBD NAME=VENDOR, ACCESS=HDAM DATASET DD 1=VENDDD, DEVICE=3380 SEGM NAME=VENSEG, PARENT=0, BYTES=10 FIELD NAME=(VENCODE, SEQ, U), BYTES=10, START=1, TYPE=C SEGM NAME=ITEMSEG, PARENT=VENSEG, BYTES=5 FIELD NAME=(ITEMCODE, SEQ, U), BYTES=5, START=1, TYPE=C SEGM NAME=LOCNSEG, PARENT=ITEMSEG, BYTES=9 FIELD NAME=(LOCNCODE, SEQ), BYTES=3, START=1, TYPE=C FIELD DBDGEN FINISH END NAME=ORDDATE, BYTES=6, START=4, TYPE=C
Macros of DBDGEN § DBD : Names the database and identifies the access method DBD Name = VENDOR, ACCESS=HDAM § DATASET : Specifies DD Name used in the JCL and other parameters § SEGM : Names the segment. Identifies the parent and establishes the length § FIELD : Defines fields types and identifies search &key fields § DBDGEN: Indicates the end of the DBDGEN process § END; specifies the end of the assembler program.
Data types used In DBDGEN TYPE DESCRIPTION COBOL PICTURE C Character(default) X P Packed decimal COMP-3 Z Zoned decimal S 9 H Half word binary S 9(4) COMP F Full word binary S 9(8) COMP
Thank You Polsani Anil Kumar www. mainframes-online-training. weebly. com Polsani Anil Kumar
- Slides: 11