Sample custom EP adapter
To help you develop your own custom EP adapter, a sample is provided as source code and also as a load module.
The sample custom EP adapter is provided in the COBOL language. It is shipped as source code in the CICSTS52 .CICS.SDFHSAMP library, and also as a load module.
- The source code and load module are named
DFH0EPAC
. - Group
DFH$EPAG
is defined in DFHCURDS.DATA. The group defines programDFH0EPAC
and transaction IDEPAT
to include in your event binding to run theDFH0EPAC
program. - The sample program
DFH0EPAC
formats most data types. However, as a COBOL language sample,DFH0EPAC
cannot format binary floating point (BFP) or decimal floating point (DFP) items; in this case,DFH0EPAC
fills the data area with asterisks (*).
The program is passed a CICS event channel. It formats
the event data into an event record according to formatting information
in the DFHEP.DESCRIPTOR
container and writes the
record to a CICS temporary storage queue (TSQ). The name of the queue
can be taken from the DFHEP.ADAPTER
container, and
can be up to 16 bytes long. If that is not present, the name defaults
to userid|program for application
events or userid.SYSTEM for system events, constructed
from the information in the DFHEP.CONTEXT
container.
For example, for an application event triggered by program TEST1 running
using user ID JBLOGGS, the queue name defaults to JBLOGGS.TEST1.
Records longer than 32,000 bytes are truncated.
The sample custom EP adapter demonstrates
how a custom EP adapter handles synchronous and asynchronous emission
events. This is achieved by honoring the EPAP-RECOVER
flag
setting in the DFHEP.ADAPTPARM
container by checking
whether the temporary storage queue is recoverable or not.