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

IMS Sending Messages Using DL/I


To send a message to the message queue, you use an ISRT call to the I/O PCB, similar to the ISRT call to a database PCB, as shown in below code.

PL/I:

(  . . . BUILD OUTPUT MESSAGE AREA  . . .  )

CALL PLITDLI (C_PARM3,
              C_ISRT_FUNC,
              L_IO_PCB_PTR,
              W_OUTPUT_MESSAGE);

COBOL:

(  . . . BUILD OUTPUT MESSAGE AREA  . . .  )

CALL 'CBLTDLI' USING C - PARM3.
                     C - ISRT – FUNC,
                     L - IO – PCB,
                     W - OUTPUT - MESSAGE.

Insert to Message Queue

It has been mentioned that a message is made up of one or more segments. If you need to insert a multi-segmented message to the queue, you will need to add additional insert calls using the appropriate I/O areas. The only acceptable status code for the ISRT call is blank. All others should be treated as errors and handled in an error routine.

Another variation of an ISRT call is shown in Figure 4-16. In this example, the ISRT call is inserting a message to the message queue, but specifying a different MOD than the originating message would have used. This is useful when your program may need to perform several functions based on a standard input MID, as in the case where one application program may send several different screens back to a client based on selection data entered. It can also be used to send a formatted screen back to the client if an unformatted method was used to create the message.

When specifying a MOD in an ISRT call, it is important to keep in mind that you can only specify the MOD in the first call to the PCB. All subsequent ISRT calls to the same PCB must not specify the MOD unless a COMMIT POINT has occurred. (See Commit Points in a Message Processing Program for a discussion on commit points.)

PL/I:

(  . . . BUILD OUTPUT MESSAGE AREA  . . .  )

CALL PLITDLI (C_PARM4,
              C_ISRT_FUNC,
              L_IO_PCB_PTR,
              W_OUTPUT_MESSAGE,
              C_ABCOSTAT);	<------ optional parameter

COBOL:

(  . . . BUILD OUTPUT MESSAGE AREA  . . .  )

CALL 'CBLTDLI' USING C - PARM3.
                     C - ISRT – FUNC,
                     L - IO – PCB,
                     W - OUTPUT - MESSAGE.

Insert to Message Queue with Different MOD


Commit Points in an MPP:

One thing to plan for in designing an MPP is resource integrity. IMS will not allow other application programs to access data your MPP has updated until your MPP reaches a commit point. At a commit point, IMS treats as permanent any changes to databases and to the I/O PCB. Until your MPP reaches a commit point, IMS holds any output messages in a buffer area. This is in case of an abnormal termination, the message is not sent to a terminal or application program by mistake and any database updates are backed out and not made permanent.

Three things in the execution of your MPP may cause a commit point to occur.

  • The successful termination of your application program.

  • A Basic Checkpoint call. MPP’S do not support symbolic checkpoint/restart. A big drawback in having an MPP issue a checkpoint call is that IMS also issues an internal GU to the message queue. Your program must be able to handle multiple input messages before the current message is completely processed.

  • A GU to the message queue may cause a commit point. If the MPP has MODE=SNGL on the TRANSACT macro at system definition time, a commit point is reached when a GU to the I/O to the I/O PCB is issued. If the MODE=MULT, then a GU to the I/O PCB does not cause a commit point.

For further discussion of commit points in an MPP, refer to the IMS/VS Application Programming Guide.



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