To take advantage of a modifiable PCB, issue a DL/I change call. The change call has a function code of CHNG. Its function is to direct IMS to associate a particular LTERM or transaction code with a specific modifiable PCB. You issue the change call prior to issuing an ISRT call to the PCB.
The CHNG will direct IMS, for all subsequent ISRT calls to that PCB, to send the message to the proper destination. An example of a CHNG call, followed by an ISRT call of an output message area (which will be displayed on a format for an alternate device such as a printer), is shown in below code.
The messages so inserted can be sent to the destination with the PURG call. The PURG call tells IMS that the message building is complete and the message may be sent onwards to the destination. You issue the PURG call before taking a sync point or issuing a GU against the I/O PCB.
The destination needs to be set after every GU call to the I/O PCB as that implies a sync point for the application.
The Alternate PCB(s) are defined ahead of other PCB(s) and therefore you need to take this into account when defining the linkage section (or using the PCB pointers in PL/I).
Let's assume that the LTERM name for the printer is HAH23V, and that we want to use a particular report format, CT7ORPT1.
W_DESTINATION = 'HAH23V': <---- Set up LTERM destination CALL PLITDLI (C_PARM3, C_CHNG_FUNC, L_ALT_IO_PCB_PTR, W_DESTINATION); • • W_FMT_MODNAME = 'CT7ORPT1'; <---- Set up format MOD name CALL PLITDLI (C_PARM4, C_ISRT_FUNC, L_ALT_IO_PCB_PTR, W_OUTPUT_MESSAGE, W_FMT_MODNAME);
MOVE 'HAH23V ' TO W-DESTINATION. <---- Set up LTERM destination CALL 'CBLTDLI' USING C-PARM3, C-CHNG-FUNC, L-ALT-IO-PCB, W-DESTINATION. • • MOVE 'CT7ORPT1 ' TO W-FMT-MODNAME. <---- Set up format MOD name CALL 'CBLTDLI' USING C-PARM4, C-ISRT-FUNC, L-ALT-IO-PCB, W-OUTPUT-MESSAGE, W-FMT-MODNAME.
Change Call, with Insert, to Modifiable PCB (LTERM)
Remember from the discussion of the ISRT call that you can only use the optional format parameter on the ISRT call for the first call. The application program must cause a commit point, or issue another CHNG call before it can ISRT with the format parameter specified.
The specification of a transaction code in the PCB, via a CHNG call or hard coded PCB in the PSB, is known as a program-to-program message switch. This allows you to schedule IMS online programs from IMS online programs.
Below code shows the code necessary to perform a program-to-program message switch. Let's assume we want to schedule transaction 'CT7P1000' from a currently executing program.
W_TRANCODE = 'CT7P1000': <---- set up Transaction code as destination CALL PLITDLI (C_PARM3, C_CHNG_FUNC, L_ALT_IO_PCB_PTR, W_TRANCODE); • • W_ALT_OUTPUT_MSG_TRAN = 'CT7P1000': <---- insert Transaction code into the message CALL PLITDLI (C_PARM3, C_ISRT_FUNC, L_ALT_IO_PCB_PTR, W_ALT_OUTPUT_MSG);
MOVE 'CT7P1000' TO W-TRANCODE. <---- set up Transaction code as destination CALL 'CBLTDLI' USING C-PARM3 C-CHNG-FUNC L-ALT_IO-PCB W-TRANCODE. • • MOVE 'CT7P1000' TO W-ALT-OUTPUT-MSG-TRAN. <---- insert Trans code into the message CALL 'CBLTDLI' USING C-PARM3 C-ISRT_FUNC L-ALT-IO-PCB W-ALT-OUTPUT-MSG;
Change Call, with Insert, to Modifiable PCB (Transaction)
The ZZ byte of the message must be set to binary 0 or 1 prior to inserting the message. The LL will depend on the length of the message.
If your PSB does not specify a modifiable PCB, it is not allowed to issue the CHNG call. When you issue a CHNG call, it will remain in effect until.
Another CHNG call is issue to the same PCB.
Your program terminates.
A GU call to the message queue is issued.
If the application program needs to send messages to multiple output destinations, it is recommended that it also issue the PURG call prior to the subsequent CHNG calls, so that IMS knows the message is complete and will send the message to its destination.
The only acceptable status code from the CHNG call is blanks. If an A1 status is returned to the application program, it means that the LTERM or transaction code is not defined to IMS.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!