Before you can run an application program under IMS, you must define and generate the control blocks that are described in the following sections. IMS Control BlocksBefore executing an application program under IMS, you must describe that program and its use of logical terminals and logical data structures through a program specification block (PSB) generation, using the PSB Generation utility. The PSB contains one PCB for each DL/I database (logical or physical) the application program will access. The PCBs specify which segments the program will use and the kind of access (retrieve, update, insert, delete) for which the program is authorized. The PSBs are maintained in one or more IMS system libraries called a PSBLIB library. All IMS databases require a database descriptor block (DBD) created to have access to any IMS databases. The details of these control blocks are described in "Generating IMS Control Blocks" on page 233. The DBD is assembled into a system library called a DBDLIB. The IMS system needs to combine and expand the PSB and DBD control blocks into an internal format called application control blocks (ACBs). The Application Control Blocks Maintenance utility is used to create the ACBs. For a DB batch environment, the ACB blocks are either built dynamically at step initialization time (as specified in the DLIBATCH procedure) or the ACB blocks are built by running the Application Control Blocks Maintenance utility (as specified in the DBBBATCH procedure). In an online environment, the ACB blocks need to be created before an application can be scheduled and run. The Application Control Blocks Maintenance utility is run offline and the resulting control blocks are placed in an ACB library (IMS.ACBLIB). The IMS system needs to access these control blocks (DBDs and PSBs) in order to define the application's use of the various IMS resources required. The environment in which the application program is executed determines how IMS accesses those control blocks. See Figure 14-9 on page 234 for an overview of the processing. Figure 14-9. IMS Control Block Generation and Usage
The Transaction Processing (TP) PCBBesides the default TP PCB (also known as the I/O PCB), which does not require a PCB statement in a PSB generation, additional TP PCBs (sometimes called alternate PCBs) can be coded. These TP PCBs are used to insert output messages to:
Figure 14-7 is an example of a TP PCB. Figure 14-7. Sample TP PCB01 TPPCB. 02 LTERM PICTURE X(8). Logical Terminal Name 02 FILLER PICTURE XX. Reserved 02 STATUS-CODE PICTURE XX. Status Code The destination of the output LTERM can be set in two ways:
The method used depends on the PCB statement. The PCB StatementThis is the only statement required to generate an alternate PCB (multiple occurrences are allowed). Its format is: PCB TYPE=TP, LTERM=name, MODIFY=YES Table 14-4 describes the possible keywords.
The Database PCBThe DB PCB for a BMP program or MPP can be simple or complex. The DB PCB has two more processing intent options than the TP PCB. These additional processing intent options can be specified with the PROCOPT= keyword of the PCB or the SENSEG statement or both. Figure 14-8 is an example of a simple DB PCB: Figure 14-8. Example of a Simple DB PCBPCB TYPE=DB, X DBDNAME=EXCEPTA, X PROCOPT=A, X KEYLEN=24 X SENSEG NAME=QB01, X PARENT=0 In Figure 14-8: TYPE=DB
DBDNAME=name
PROCOPT=
Related Reading: There are more processing options than are listed here. For more information about all the processing options, see IMS Version 9: Application Programming: Design Guide. KEYLENGTH=
SENSEG
Related Reading: For more information about generating these control blocks, see IMS Version 9: Utilities Reference: System. Generating IMS Control BlocksIn addition to database PCBs, a PSB for MPPs or BMP programs contains one or more TP PCBs. The order of the PCBs in the PSB must be:
One TP PCB (an I/O PCB) is always automatically included by IMS at the beginning of each PSB of an MPP or BMP program. This default TP PSB is used to insert output messages back to the originating LTERM or USERID and can also be used for system service calls such as CHKP. Generating PSBsThe PSBGEN statement is basically the same as a DB PCB statement. The only real differences are that the IOEROPN= parameter must be omitted and the COMPAT=YES parameter is ignored. Generating ACBsBefore PSBs and DBDs can be used by the control region, they must be expanded to an internal control block format. This expansion is done by the Application Control Blocks Maintenance (ACBGEN) utility. The expanded control blocks are maintained in the IMS.ACBLIB library. This is a standard z/OS partitioned data set. An ACBGEN procedure is placed in IMS.PROCLIB during IMS system definition. Note: Multiple BUILD statements can be coded for both DBDs and PSBs and, if IMS.ACBLIB is already populated, the order does not matter. If IMS.ACBLIB is not populated, specify the DBDs first. Better yet, specify only PSBs (not DBDs) and let the ACBGEN utility find and use the correct DBDs. If you want to completely populate IMS.ACBLIB from a PSBLIB and a DBDLIB, use just the single statement BUILD PSB=ALL. The ACBGEN utility knows what to do with the DBDs. |