Sample IMS synchronous callout application

An IMS synchronous callout application must declare the IMS Application Interface Block (AIB) field for the ICAL call and the message processing program (MPP) request and response messages.

The following example demonstrates the required AIB field declaration for the ICAL call in the COBOL program.
01 AIB.
   02 AIBRID PIC x(8)  VALUE 'DFSAIB  '.
   02 AIBRLEN PIC 9(9) USAGE BINARY.
   02 AIBSFUNC PIC x(8) VALUE 'SENDRECV'.
   02 AIBRSNM1 PIC x(8) VALUE 'OTMADEST'.
   02 AIBRSNM2 PIC x(8).
   02 AIBRESV1 PIC x(8).
   02 AIBOALEN PIC 9(9) USAGE BINARY.
   02 AIBOAUSE PIC 9(9) USAGE BINARY.
   02 AIBRSFLD PIC 9(9) USAGE BINARY VALUE 10000.
   02 AIBRESV2 PIC x(8).
   02 AIBRETRN PIC 9(9) USAGE BINARY.
   02 AIBREASN PIC 9(9) USAGE BINARY.
   02 AIBERRXT PIC 9(9) USAGE BINARY.
The following example shows the declarations in the COBOL program for synchronous callout request (purchase order) and response messages (order confirmation).
01 PurchaseOrder.
   02 item-lim PIC S9(9) COMP-5.
   02 comment-lim PIC S9(9) COMP-5.
   02 orderDate-att PIC X(64) DISPLAY.
   02 shipTo.
      03 name PIC X(64) DISPLAY.
      03 street PIC X(64) DISPLAY.
      03 city PIC X(64) DISPLAY.
      03 state PIC X(64) DISPLAY.
      03 zip PIC X(64) DISPLAY.
   02 billTo.
      03 name1 PIC X(64) DISPLAY.
      03 street1 PIC X(64) DISPLAY.
      03 city1 PIC X(64) DISPLAY.
      03 state1 PIC X(64) DISPLAY.
      03 zip1 PIC X(64) DISPLAY.
   02 items.
      03 item
         OCCURS 0 TO 32 TIMES
         DEPENDING ON item-lim
         OF PurchaseOrder.
         04 partNum-att PIC X(64) DISPLAY.
         04 productName PIC X(64) DISPLAY.
         04 quantity PIC S9(31) COMP-3.
         04 USPrice PIC S9(25)V9(6) COMP-3.
         04 available PIC X DISPLAY.
         04 dateAvail PIC X(64) DISPLAY.
         04 comment PIC X(100) DISPLAY
            OCCURS 0 TO 2 TIMES
            DEPENDING ON comment-lim
            OF PurchaseOrder.
                  
01 OrderConfirmation.
   02 comment-lim PIC S9(9) COMP-5.
   02 orderID PIC 9(9) COMP-5.
   02 itemCount PIC S9(31) COMP-3.
   02 USTotal PIC S9(25)V9(6) COMP-3.
   02 shipDate PIC X(64) DISPLAY.
   02 comment PIC X(100) DISPLAY
      OCCURS 0 TO 3 TIMES
      DEPENDING ON comment-lim
      OF OrderConfirmation.