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
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);
endAs 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.
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...
endAs shown, the records include the data required by MFS.
Setting the callLink element in the linkage options part
- 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
- EGL-generated Java™ code creates an IMS™ interaction and calls the execute method on that interaction, passing the input and output records
- 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
- 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
- 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.