TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB IMS-DC Tools Articles Forum Quiz Interview Q&A

IMS Message Processing - Alternate PCB


Normally, when you write an IMS online application program, you will communicate back and forth with the sending device. What if there is a need to send a message to a device other than the sending device, or to schedule another transaction based on input from the sending message?.

IMS provides for these situations through the use of alternate PCBs. (Remember, PCBs are specified in the PSB.) The I/O PCB is not included in the PSB; however, alternate PCBs must be, and must be coded before any database PCBs. Depending on your needs, an alternate PCB in several ways. The various methods are shown in below code.

PCB TYPE=TP,NAME=tranname....
PCB TYPE=DB,NAME=dbdname....
•
•
PSBGEN LANG=....PSBNAME=...

HARDCODED LTERM

PCB TYPE=TP,LTERM=ltermname....
PCB TYPE=DB,NAME=dbdname....
•
•
PSBGEN LANG=....PSBNAME=...

MODIFIABLE PCB

PCB TYPE=TP,MODIFY=YES....
PCB TYPE=DB,NAME=dbdname....
•
•
PSBGEN LANG=....PSBNAME=...

Examples of PSB’S with Alternate PCBs

The preferred method is the modifiable PCB. The other methods explicitly specify an LTERM or transaction name. If an LTERM or transaction changes, the PSB needs to be changed and regenerated. With the modifiable PCB, you can dynamically specify from within the application program the LTERM or transaction you want to work with, instead of changing the PSB.


Alternate I/O PCB Specification:

Below code shows where you would add an alternate I/O PCB in your PL/I PROC OPTIONS MAIN pointer list, or your COBOL ENTRY USING statement.

PL/I:
  OLPGM:  PROC  (L_IO_PCB_PTR,      &tl--- I/O PCB Pointer
                 L_ALT_IO_PCB_PTR,  &tl--- Alternate I/O PCB Pointer
                 L_DB1_PCB_PTR,     &tl--- Data Base PCB Pointer
  •
  •
                 L_DBn_PCB_PTR)			&tl--- Data Base PCB Pointer
                 OPTIONS (MAIN);

COBOL
  ENTRY  'DLITCBL' USING L-IO-PCB,      &tl--- I/O PCB
                         L-ALT-IO-PCB,	&tl--- Alternate I/O PCB
                         L-DB1-PCB,     &tl--- Data Base PCB
  •
  •
                         L-DBn-PCB.     &tl--- Data Base PCB

Alternate I/O PCB Coding


Alternate PCB Mask:

Like the I/O PCB, you need to code a PCB mask for the alternate PCB. The alternate PCB mask contains only three fields: the destination, the reserved IMS field and the status code. Figure 4-24 shows the typical code needed for an alternate PCB mask.

PL/I:
  DCL  01  L_ALT_IO_PCB      BASED(L_ALT_IO_PCB_PTR),
       05  L_LTERM_TRAN      CHAR(8),
       05  L_IMS_RSVD        CHAR(2),
       05  L_STATUS_CODE     CHAR(2);

COBOL
  LINKAGE SECTION.
  01   L-ALT-IO-PCB.
         05  L-LTERM-TRAN     PIC  X(8).
         05  L-IMS-RSVD       PIC  X(2).
         05  L-STATUS-CODE    PIC  X(2).



If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!

Are you looking for Job Change? Job Portal