Container DFHFUNCTION

DFHFUNCTION is a container of DATATYPE(CHAR) that contains a 16-character string that indicates where in a pipeline a program is being invoked.

The string has one of the following values. The rightmost character positions are padded with blank characters.
RECEIVE-REQUEST
The handler is a non-terminal handler in a service provider pipeline, and is being invoked to process an inbound request message. On entry to the handler, the message is in control container DFHREQUEST.
SEND-RESPONSE
The handler is a non-terminal handler in a service provider pipeline, and is being invoked to process an outbound response message. On entry to the handler, the message is in control container DFHRESPONSE.
SEND-REQUEST
The handler is being invoked by a pipeline that is sending a request; that is, in a service requester that is processing an outbound message
RECEIVE-RESPONSE
The handler is being invoked by a pipeline that is receiving a response; that is, in a service requester that is processing an inbound message
PROCESS-REQUEST
The handler is being invoked as the terminal handler of a service provider pipeline
NO-RESPONSE
The handler is being invoked after processing a request, when there is no response to be processed.
HANDLER-ERROR
The handler is being invoked because an error has been detected.
In a service provider pipeline that processes a request and returns a response, the values of DFHFUNCTION that occur are RECEIVE-REQUEST, PROCESS-REQUEST, and SEND-RESPONSE. Figure 1 shows the sequence in which the handlers are invoked, and the values of DFHFUNCTION that are passed to each handler.
Figure 1. Sequence of handlers in a service provider pipelineA service requester is connected to CICS Transaction Server. The pipeline contains three handlers: handler 1 and handler 2 are non-terminal handlers; handler 3 is the terminal handler, which links to the application program.
Sequence Handler DFHFUNCTION
1 Handler 1 RECEIVE-REQUEST
2 Handler 2 RECEIVE-REQUEST
3 Handler 3 PROCESS-REQUEST
4 Handler 2 SEND-RESPONSE
5 Handler 1 SEND-RESPONSE
In a service requester pipeline, that sends a request and receives a response, the values of DFHFUNCTION that occur are SEND-REQUEST and RECEIVE-RESPONSE. Figure 2 shows the sequence in which the handlers are invoked, and the values of DFHFUNCTION that are passed to each handler.
Figure 2. Sequence of handlers in a service requester pipelineCICS Transaction Server is connected to a service provider. The application links to the pipeline, which contains three handlers: handler 1, handler 2 and handler 3 are non-terminal handlers.
Sequence Handler DFHFUNCTION
1 Handler 1 SEND-REQUEST
2 Handler 2 SEND-REQUEST
3 Handler 3 SEND-REQUEST
4 Handler 3 RECEIVE-RESPONSE
5 Handler 2 RECEIVE-RESPONSE
6 Handler 1 RECEIVE-RESPONSE
The values of DFHFUNCTION that can be encountered in a given message handler depends upon whether the pipeline is a provider or requester, whether the pipeline is in the request or response phase, and whether the handler is a terminal handler or a non-terminal handler. The following table summarizes when each value can occur:
Value of DFHFUNCTION Provider or requester pipeline Pipeline phase Terminal or non-terminal handler
RECEIVE-REQUEST Provider Request phase Non-terminal
SEND-RESPONSE Provider Response phase Non-terminal
SEND-REQUEST Requester Request phase Non-terminal
RECEIVE-RESPONSE Requester Response phase Non-terminal
PROCESS-REQUEST Provider Request phase Terminal
NO-RESPONSE Both Response phase Non-terminal
HANDLER-ERROR Both Both Both