Calling a remote IMS transaction from EGL-generated Java code or the debugger

An EGL-generated Java™ program or the debugger can invoke a nonconversational, single-segment IMS™ transaction by way of IMS Connect. You must pass a separate input and output record, each of which includes details that are specific to IMS, and you must set the linkage part appropriately.

For details on a different variation of IMS access, see “Calling a remote IMS program from EGL-generated Java code or the debugger."

Writing the EGL code

The coding task is to define an input and output record and to write a call statement that includes those records. The input record must match the message that the IMS transaction expects to retrieve from the IMS message queue, and the output record must match the message that the IMS transaction inserts to the message queue. For example, the following code invokes transaction TXN1 and provides both the IMS header information and the data:
   inRec InputRecord;
   outRec OutputRecord;

   inRec.TRANSCODE = "TXN1";
   call "TXN1"(inRec, outRec);

   record InputRecord type BasicRecord
      10 LL smallInt;         // IMS LL field
      10 ZZ smallInt;         // IMS ZZ field
      10 TRANSCODE char(8);   // IMS transaction code
      10 data;                // user data
         15 f1 char(10);
         15 f2 char(20);
   end

   record OutputRecord type BasicRecord
      10 LL smallInt;         // IMS LL field
      10 ZZ smallInt;         // IMS ZZ field
      10 data;                // user data
         15 f2 char(20);
         15 f3 char(20);
         15 f4 char(20);
   end

As shown, the call statement and the input record each include the transaction code, and the input and output records each include the IMS LL and ZZ fields.

In a second example, the IMS transaction TXN2 expects input in the form of an MFS map and responds to the caller with an MFS map. Here are the record parts:
   record InputRecord type BasicRecord
      10 LL smallInt;                   // IMS LL field
      10 ZZ smallInt;                   // IMS ZZ field
      10 MID-TRANSCODE char(8);         // IMS transaction code
      10 ...                            // Other MFS MOD header data
      10 data;                          // user data
         15 field1Attribute char(8);
         15 field1Data... 
   end

   record OutputRecord type BasicRecord
      10 LL smallInt;                   // IMS LL field
      10 ZZ smallInt;                   // IMS ZZ field
      10 ...                            // other MFS MOD header data
      10 data;                          // user data
         15 field1Attribute char(8);    // account for MFS attribute bytes
         15 field1Data...
   end

As shown, the records include the data required by MFS.

Setting the callLink element in the linkage options part

The linkage build descriptor option must reference a linkage options part that includes a callLink element for the called transaction. Do as follows when you work on the callLink element:
  • Set type set to REMOTECALL
  • Set remotePgmType set to STATELESS
  • Set remoteComType set to IMSTCP or IMSJ2C
  • Set conversionTable, location, and serverID as appropriate for the remoteComType setting, as described in the reference topics for those attributes

Understanding the runtime and IMS planning details

At run time, the process is as follows:
  1. EGL-generated Java code creates an IMS interaction and calls the execute method on that interaction, passing the input and output records
  2. IMS Connect provides the input data to the IMS message queue, and the IMS transaction retrieves it by issuing a GU call to the I/O PCB
  3. After processing the input data, the IMS transaction inserts output data to the message queue by issuing an ISRT call to the I/O PCB
  4. IMS Connect returns the output data to the execute method, which returns the data to the caller

For further details on how IMS Connect interacts with Java code and with the IMS transaction, see the IMS Connect documentation.

The EGL-generated Java invocation requires no changes to an existing IMS PSB or to the APPLCTN and TRANSACT macros in the IMS stage 1 generation.


Feedback