IMS DB Control Block PSBGEN IMS Training Class
IMS DB Control Block- PSBGEN IMS Training Class 03
DBD for Company Information Database ORGSEG 1 2 3 v. Root Segment v. Parent Segment v. Child Segment v. Segment Level Client Info Clients Employee v. Segment Occurrence Project Info Projects Salary v. Path v. Database Record v. Twins
DBDGEN Program for Company Database DBD NAME=COMPANY, ACCESS=(HDAM, VSAM) DATASET DD 1=COMPDD, DEVICE=3380 SEGM NAME=ORGSEG, PARENT=0, BYTES=40 FIELD NAME=(ORGCODE, SEQ, U), BYTES=3, START=1, TYPE=P FIELD NAME=ORGNAME, BYTES=5, START=4, TYPE=C FIELD NAME=ORGLOC, BYTES=12, START=9, TYPE=C FIELD NAME=ORGHEAD, BYTES=20, START=21, TYPE=C SEGM NAME=CLIENT, PARENT=ORG, BYTES=45 FIELD NAME=(CLTID, SEQ, U), BYTES=4, START=1, TYPE=P FIELD NAME=CLTNAME, BYTES=10, START=5, TYPE=C FIELD NAME=CLTLOC, BYTES=11, START=15, TYPE=C FIELD NAME=CLTHEAD, BYTES=20, START=26, TYPE=C SEGM NAME=PROJECT, PARENT=CLIENT, BYTES=35 FIELD NAME=(PRJID, SEQ, U), BYTES=4, START=1, TYPE=P FIELD NAME=PRJNAME, BYTES=5, START=5, TYPE=C FIELD NAME=PRJTMSIZE, BYTES=4, START=10, TYPE=C FIELD NAME=PRJHEAD, BYTES=22, START=14, TYPE=C
DBDGEN Program for Company Database SEGM NAME=EMPLOY, PARENT=ORG, BYTES=40 FIELD NAME=(EMPID, SEQ, U), BYTES=5, START=1, TYPE=P FIELD NAME=EMPNAME, BYTES=10, START=6, TYPE=C FIELD NAME=EMPPROJ, BYTES=5, START=16, TYPE=C FIELD NAME=EMPADDR, BYTES=20, START=21, TYPE=C SEGM NAME=SALARY, PARENT=EMPLY, BYTES=35 FIELD NAME=(SALEMPID, SEQ, U), BYTES=5, START=1, TYPE=P FIELD NAME=SALBASIC, BYTES=10, START=6, TYPE=C FIELD NAME=SALHRA, BYTES=5, START=16, TYPE=C FIELD NAME=SALDA, BYTES=5, START=21, TYPE=C DBDGEN FINISH END
PSB Control Block PSB Program Specification Block Describes Logical structure of the Database that a program will use. It contains one or more PCB’s (Program Communication Block). PSBGEN Produces a load module stored in the PSBLIB library and creates PSB
Program Communication Block The PCB is the program’s view of database. It defines the database to be accessed and the scope of the program’s access. The PCB defines the “Segment Sensitivity” ( i. e. segments available to the program). If a PCB does not contain one or more of the segment in the database, the program is “Not Sensitive “ to these segments. A program’s view of the database may be the same or different than the “physical view” of the database.
PSB view Database A Database B Database C DBD PCB X PCB Y PSB Program 1
PSB sample code PCB TYPE=DB, DBDNAME=COMPANY, KEYLEN=10, PROCOPT=LS SENSEG NAME=ORGSEG, PARENT=0 SENSEG NAME=CLIENT, PARENT=ORGSEG SENSEG NAME=PROJECT, PARENT=CLIENT PSBGEN PSBNAME=MYPSB, LANG=COBOL END PCB TYPE=DB, DBDNAME=COMPANY, KEYLEN=10, PROCOPT=LS SENSEG NAME=ORGSEG, PARENT=0 SENSEG NAME=CLIENT, PARENT=ORGSEG SENSEG NAME=PROJECT, PARENT=CLIENT SENSEG NAME=EMPLOY, PARENT=ORGSEG SENSEG NAME=SALARY, PARENT=EMPLY PSBGEN PSBNAME=MYPSB, LANG=COBOL END
PSBGEN Macros PCB : Describes type (DB or DC), name of the DBD, Key length(length of the longest concatenated key the program can process) and processing Option (Defines how the segment may be accessed) SENSEG : Define the name of the segments in the Database to which our program needs access SENFLD : Subordinate to the SENSEG macro, only fields that are defined by the SENFLD macro can be accessed from the I/O Area. PSBGEN : Specifies the PSB name and the host language name END : End of the assembler program
PCB Processing Option PCB also states processing option available ( i. e. ADD, UPDATE, DELETE or READ). The processing options allowed in a PCB are : G To read a segment R To change (replace) a segment I To add a segment D To delete a segment A All except load L To load a database LS To load (data must be in key sequence) There is an additional option of ‘O’, for ONLY, which is used with the get option when the program is going to ‘read only’.
Application Control Block (ACB) When IMS executes an application program, it uses an ACB. An ACB is the run-time control block that is a consolidation of PSBs and DBDs. For batch programs , IMS dynamically creates the ACB from PSB and DBD. For online programs, an ACBGEN is run which merges the DBD and PSB and creates the ACB before execution. ACB GENERATION(ACBGEN) DBDLIB PSBLIB ACB GEN ACBLIB
Application Control Block (ACB) § The DBD and PSB information needs to be merged (into control blocks) before a program access a database. This process will take some time; this is not a problem for batch programs, but is an unwanted overhead for online execution. § In order to avoid this online overhead, the DBA will construct an ACBGEN. This builds a number of Application Control Blocks which must then be linked into the load library before the IMS program can be run.
Thank You Polsani Anil Kumar
- Slides: 13