Using the local ECI resource adapter to link to a program in CICS

Running a program in CICS® using the JCA local ECI resource adapter is done by using the execute() method of the ECIInteraction class.

About this task

This task shows an application developer how to use the JCA local ECI resource adapter to run a CICS program passing in a COMMAREA using a JCA record. For further details on how to extend the Record interface to represent a CICS COMMAREA, see Using the JCA local ECI resource adapter with COMMAREA and for details on how to link to a CICS program that uses channels and containers, see Using the JCA local ECI resource adapter with channels and containers .

Procedure

  1. Use JNDI to look up the ConnectionFactory object named eis/defaultCICSConnectionFactory.
  2. Get a Connection object from the ConnectionFactory.
  3. Get an Interaction object from the Connection.
  4. Create a new ECIInteractionSpec object.
  5. Use the set methods on ECIInteractionSpec to set the properties of the execution, such as the program name and COMMAREA length.
  6. Create a record object to contain the input data (see COMMAREA/Channel topics) and populate the data.
  7. Create a record object to contain the output data.
  8. Call the execute method on the Interaction, passing the ECIInteractionSpec and two Record objects.
  9. Read the data from the output record.

Results

You have successfully linked to a program in CICS using the ECI resource adapter.