Another method of maintaining position in more than one place in a given database is through the use of multiple PCB’s. One PCB is defined for each unique position the programmer wishes to maintain. Also a program may require access to two different logical data structures, each describing different segments in the same database. Thus the program’s PSB may contain more than one PCB for the same database.
In COBOL program ENTRY statement normally includes a parameter for each PCB statement included in the PSB. The parameters must be coded in the same order in which the PCBs appear in the PSB. Figure below shows COBOL coding to access three PCBs.
LINKAGE SECTION. 01 PCB-1. 03 DATA-BASE-NAME PIC X(08). 03 CURRENT-SEGMENT-LEVEL PIC X(02). 03 STATUS-CODE PIC X(02). 03 DLI-PROCESSING-CODE PIC X(04). 03 RESERVED-FOR-DLI PIC S9(09) COMP. 03 SEGMENT-NAME-FEEDBACK PIC X(08). 03 LEN-OF-CONCATENATED-KEY PIC S9(09) COMP. 03 NUMBER-OF-SENSITIVE-SEG PIC S9(09) COMP. 01 PCB-2. ......... ........
PROCEDURE DIVISION. ENTRY 'DLITCBL' USING PCB-1 PCB-2. .......... ..........
Multiple positioning is a means of maintaining more than one position in a database. The use of multiple PCBs extends the capabilities of multiple postioning.
When multiple positioning is used, IMS maintains a position in each hierarchical path. However, if it is necessary to maintain two positions in the same path, then multiple positioning is not adequate. Since a PCB allows a unique and independent position to be maintained, multiple PCB’s could be employed to maintain more than one position in a given hierarchical path.
The multiple positioning method is limited to a single database record. If all the positions to be maintained are not within the same database record, then multiple positioning is not sufficient. But if multiple PCB’c are used, IMS can use each PCB to maintain a position which is not dependent on any other position. Thus, simultaneous position in several database records is possible using multiple PCB'c for the same database.
Multiple PCB's may be used in place of multiple positioning in any application. To accomplish this, one PCB is required for each hierarchical path in the database.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!